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 test for issue 1919 #2013

Merged
merged 3 commits into from
Aug 12, 2020

Conversation

dvkruchinin
Copy link
Contributor

Motivation and context

Add Cypress test for issue 1919

How has this been tested?

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

@dvkruchinin dvkruchinin requested a review from azhavoro as a code owner August 11, 2020 09:30
@dvkruchinin dvkruchinin force-pushed the dkru/cypress_test_issue_1919 branch from 528870c to 54c5371 Compare August 11, 2020 11:27
@coveralls
Copy link

coveralls commented Aug 11, 2020

Pull Request Test Coverage Report for Build 6893

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 68.938%

Totals Coverage Status
Change from base Build 6871: 0.0%
Covered Lines: 11129
Relevant Lines: 15658

💛 - Coveralls

before(() => {
cy.visit('auth/login')
cy.login()
cy.get('[type="submit"]').click()
Copy link
Member

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()?

Copy link
Contributor Author

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.

Comment on lines 18 to 19
const width='800'
const height='800'
Copy link
Member

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?

Copy link
Contributor Author

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')
Copy link
Member

@bsekachev bsekachev Aug 11, 2020

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

Copy link
Contributor Author

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.

Comment on lines 34 to 38
cy.contains('strong', taskName)
.parent()
.parent()
.parent()
.contains('a', 'Open').click()
Copy link
Member

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()

Copy link
Contributor Author

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.

@bsekachev bsekachev merged commit b9f47fd into cvat-ai:develop Aug 12, 2020
@dvkruchinin dvkruchinin deleted the dkru/cypress_test_issue_1919 branch August 19, 2020 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants