test: minor fix

This commit is contained in:
Shariq Ansari 2021-11-08 11:00:45 +05:30
parent ee07134db2
commit cf416aa779
2 changed files with 7 additions and 11 deletions

View file

@ -13,7 +13,7 @@ context('Timeline', () => {
cy.get('.page-head .page-actions').findByRole('button', {name: 'Save'}).click();
cy.visit('/app/todo');
cy.click_first_row_in_list();
cy.click_listview_row_item(0);
//To check if the comment box is initially empty and tying some text into it
cy.get('[data-fieldname="comment"] .ql-editor').should('contain', '').type('Testing Timeline');
@ -66,7 +66,7 @@ context('Timeline', () => {
cy.click_modal_primary_button('Submit');
cy.visit('/app/custom-submittable-doctype');
cy.click_first_row_in_list();
cy.click_listview_row_item(0);
//To check if the submission of the documemt is visible in the timeline content
cy.get('.timeline-content').should('contain', 'Administrator submitted this document');
@ -78,14 +78,14 @@ context('Timeline', () => {
//Deleting the document
cy.visit('/app/custom-submittable-doctype');
cy.select_first_row_checkbox();
cy.select_listview_row_checkbox(0);
cy.get('.page-actions').findByRole('button', {name: 'Actions'}).click();
cy.get('.page-actions .actions-btn-group [data-label="Delete"]').click();
cy.click_modal_primary_button('Yes');
//Deleting the custom doctype
cy.visit('/app/doctype');
cy.select_first_row_checkbox();
cy.select_listview_row_checkbox(0);
cy.get('.page-actions').findByRole('button', {name: 'Actions'}).click();
cy.get('.page-actions .actions-btn-group [data-label="Delete"]').click();
cy.click_modal_primary_button('Yes');

View file

@ -341,7 +341,7 @@ Cypress.Commands.add('click_sidebar_button', (btn_name) => {
});
Cypress.Commands.add('click_listview_row_item', (row_no) => {
cy.get('.list-row > .level-left > .list-subject > .bold > .ellipsis').eq(row_no).click({force: true});
cy.get('.list-row > .level-left > .list-subject > .level-item > .ellipsis').eq(row_no).click({force: true});
});
Cypress.Commands.add('click_filter_button', () => {
@ -356,10 +356,6 @@ Cypress.Commands.add('click_timeline_action_btn', (btn_name) => {
cy.get('.timeline-message-box .actions .action-btn').contains(btn_name).click();
});
Cypress.Commands.add('click_first_row_in_list', () => {
cy.get('.frappe-list .list-row-container .level-item.ellipsis').first().click();
});
Cypress.Commands.add('select_first_row_checkbox', () => {
cy.get('.frappe-list .select-like > .list-row-checkbox').first().click();
Cypress.Commands.add('select_listview_row_checkbox', (row_no) => {
cy.get('.frappe-list .select-like > .list-row-checkbox').eq(row_no).click();
});