Skip to content

Commit

Permalink
Cypress. Fix tests. (#3783)
Browse files Browse the repository at this point in the history
* Additional fix case 28

* Fix case 69

* Additional fix case 31.

* case 69
  • Loading branch information
dvkruchinin authored Oct 14, 2021
1 parent e484aa7 commit 68d412b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ 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)
.find('[type="checkbox"]')
.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(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
});

Expand Down
1 change: 1 addition & 0 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 68d412b

Please sign in to comment.