From 68d412b134030247074588ede35080b5bc76b2ac Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin Date: Thu, 14 Oct 2021 13:45:09 +0300 Subject: [PATCH] Cypress. Fix tests. (#3783) * Additional fix case 28 * Fix case 69 * Additional fix case 31. * case 69 --- .../registration_involved/case_69_filters_sorting_jobs.js | 8 ++++---- .../case_31_label_constructor_color_name_label.js | 2 ++ .../case_28_review_pipeline_feature.js | 7 ++++--- tests/cypress/support/commands.js | 1 + 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/cypress/integration/actions_tasks/registration_involved/case_69_filters_sorting_jobs.js b/tests/cypress/integration/actions_tasks/registration_involved/case_69_filters_sorting_jobs.js index 1255085b1807..fbad28479397 100644 --- a/tests/cypress/integration/actions_tasks/registration_involved/case_69_filters_sorting_jobs.js +++ b/tests/cypress/integration/actions_tasks/registration_involved/case_69_filters_sorting_jobs.js @@ -59,10 +59,9 @@ context('Filters, sorting jobs.', () => { } function testSetJobFilter({ column, menuItem, reset }) { - cy.get(column).find('[role="button"]').click().wait(300); // Waiting for dropdown menu transition + cy.get(column).find('[role="button"]').trigger('mouseover').click().wait(300); // Waiting for dropdown menu transition cy.get('.ant-dropdown') .not('.ant-dropdown-hidden') - .should('not.have.attr', 'style', 'poiner-events') .within(() => { if (!reset) { cy.contains('[role="menuitem"]', menuItem) @@ -70,11 +69,12 @@ context('Filters, sorting jobs.', () => { .should('not.be.checked') .check() .should('be.checked'); - cy.contains('[type="button"]', 'OK').click(); + cy.contains('[type="button"]', 'OK').should('be.visible').click(); } else { - cy.contains('[type="button"]', 'Reset').click(); + cy.contains('[type="button"]', 'Reset').should('be.visible').click(); } }); + cy.get('.ant-dropdown').last().should('be.hidden'); } before(() => { diff --git a/tests/cypress/integration/actions_tasks2/case_31_label_constructor_color_name_label.js b/tests/cypress/integration/actions_tasks2/case_31_label_constructor_color_name_label.js index b87dabfd9e8a..1236b48a48d2 100644 --- a/tests/cypress/integration/actions_tasks2/case_31_label_constructor_color_name_label.js +++ b/tests/cypress/integration/actions_tasks2/case_31_label_constructor_color_name_label.js @@ -151,6 +151,7 @@ context('Label constructor. Color label. Label name editing', () => { cy.contains('hex').prev().clear().type(labelColor.yellowHex); cy.contains('button', 'Cancel').click(); }); + cy.get('.cvat-label-color-picker').should('be.hidden'); cy.get('.cvat-change-task-label-color-badge') .children() .invoke('attr', 'style') @@ -170,6 +171,7 @@ context('Label constructor. Color label. Label name editing', () => { .within(() => { cy.contains('button', 'Reset').click(); }); + cy.get('.cvat-label-color-picker').should('be.hidden'); cy.get('.cvat-change-task-label-color-badge') .children() .should('have.attr', 'style') diff --git a/tests/cypress/integration/actions_users/registration_involved/case_28_review_pipeline_feature.js b/tests/cypress/integration/actions_users/registration_involved/case_28_review_pipeline_feature.js index 1a2c57c39286..6b4edad84f23 100644 --- a/tests/cypress/integration/actions_users/registration_involved/case_28_review_pipeline_feature.js +++ b/tests/cypress/integration/actions_users/registration_involved/case_28_review_pipeline_feature.js @@ -341,8 +341,9 @@ context('Review pipeline feature', () => { it('Go to "Issues" tab at right sidebar and select an issue.', () => { cy.get('.cvat-objects-sidebar').within(() => { - cy.contains('Issues').click(); + cy.contains('[role="tab"]', 'Issues').click().should('have.attr', 'aria-selected', 'true'); }); + cy.get('.cvat-objects-sidebar-issues-list-header').should('be.visible'); cy.get('.cvat-objects-sidebar-issue-item').then((sidebarIssueItems) => { cy.get('.cvat-hidden-issue-label').then((issueLabels) => { expect(sidebarIssueItems.length).to.be.equal(issueLabels.length); @@ -365,10 +366,10 @@ context('Review pipeline feature', () => { it('Issue navigation. Navigation works and go only to frames with issues.', () => { cy.get('.cvat-issues-sidebar-previous-frame').should('have.attr', 'style').and('contain', 'opacity: 0.5;'); // The element is not active - cy.get('.cvat-issues-sidebar-next-frame').trigger('mouseout').click(); + cy.get('.cvat-issues-sidebar-next-frame').should('be.visible').click(); cy.checkFrameNum(2); // Frame changed to 2 cy.get('.cvat-issues-sidebar-next-frame').should('have.attr', 'style').and('contain', 'opacity: 0.5;'); // The element is not active - cy.get('.cvat-issues-sidebar-previous-frame').trigger('mouseout').click(); + cy.get('.cvat-issues-sidebar-previous-frame').should('be.visible').click(); cy.checkFrameNum(0); // Frame changed to 0 }); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index dcb5ba0abb45..92b0b66cfa45 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -587,6 +587,7 @@ Cypress.Commands.add('changeColorViaBadge', (labelColor) => { cy.contains('hex').prev().clear().type(labelColor); cy.contains('button', 'Ok').click(); }); + cy.get('.cvat-label-color-picker').should('be.hidden'); }); Cypress.Commands.add('collectLabelsName', () => {