Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress. Fix tests. #3783

Merged
merged 4 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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