-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 test for issue 1919 #2013
Cypress test for issue 1919 #2013
Conversation
528870c
to
54c5371
Compare
Pull Request Test Coverage Report for Build 6893
💛 - Coveralls |
before(() => { | ||
cy.visit('auth/login') | ||
cy.login() | ||
cy.get('[type="submit"]').click() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't cy.get('[type="submit"]').click()
be a part of cy.login()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's better that way. Moved.
const width='800' | ||
const height='800' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we use strings instead of numbers here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jimp successfully handles this format as well. But it is better to use a numeric format. Thanks.
cy.get('#cvat_canvas_shape_1').trigger('mousemove').rightclick() | ||
}) | ||
it('Open object menu details', () => { | ||
cy.get('.cvat-canvas-context-menu > [style="display: flex; margin-bottom: 1px;"] > #cvat-objects-sidebar-state-item-1 > .ant-row > .ant-collapse > .ant-collapse-item > .ant-collapse-header > span') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we escape such long and complex selectors? They are extremely unreliable. Any minor UI change here and these tests will be broken. If you need more specific css selectors, I believe we can add them. In this case we might use for example something like this: #cvat-objects-sidebar-state-item-1 .ant-collapse-header > span
The same comment to selectors below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to shorten the selector.
cy.contains('strong', taskName) | ||
.parent() | ||
.parent() | ||
.parent() | ||
.contains('a', 'Open').click() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get this button in a simpler way? cy.get('[href="/tasks/${taskID}"]').click()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${taskID}
unknown in advance. I tried using a slightly different solution.
Motivation and context
Add Cypress test for issue 1919
How has this been tested?
Checklist
develop
branchcvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.