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

Cupress test for issue 1785 #2018

Merged
merged 6 commits into from
Aug 17, 2020

Conversation

dvkruchinin
Copy link
Contributor

Add test.
Add functionality for create zip archive with images.
Update package.json, package-lock.json.

Motivation and context

Add Cypress test for issue 1785

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 14:18
@coveralls
Copy link

coveralls commented Aug 11, 2020

Pull Request Test Coverage Report for Build 6960

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 180 unchanged lines in 6 files lost coverage.
  • Overall coverage increased (+0.8%) to 69.729%

Files with Coverage Reduction New Missed Lines %
datumaro/datumaro/components/algorithms/rise.py 5 90.7%
datumaro/datumaro/cli/main.py 11 0%
datumaro/datumaro/cli/util/init.py 15 27.59%
datumaro/datumaro/components/extractor.py 24 91.8%
datumaro/datumaro/components/operations.py 55 90.55%
datumaro/datumaro/components/project.py 70 80.0%
Totals Coverage Status
Change from base Build 6938: 0.8%
Covered Lines: 11722
Relevant Lines: 16356

💛 - Coveralls

@dvkruchinin dvkruchinin force-pushed the dkru/cypress_test_issue_1785 branch from 97102b4 to 67396a6 Compare August 12, 2020 13:23
for (let img of images) {
cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName)
}
cy.wait(2000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we wait 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.

Sometimes I encountered a situation when only 2 images were archived. The third image apparently did not exist at this point. So I decided to add a little waiting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it is because the function imageGenerator works as async. Probably we can do this command returns a promise. Then cypress will wait till this command is done

https://docs.cypress.io/api/commands/task.html#Return-a-Promise-from-an-asynchronous-task

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'll try to rework the function. Thanks.

@dvkruchinin dvkruchinin force-pushed the dkru/cypress_test_issue_1785 branch from 67396a6 to 0c00638 Compare August 17, 2020 06:41
Dmitry Kruchinin added 4 commits August 17, 2020 10:38
Add test.
Add functionality for create zip archive with images.
Update package.json, package-lock.json.
Code refactoring.
@dvkruchinin dvkruchinin force-pushed the dkru/cypress_test_issue_1785 branch from 0c00638 to a982e8c Compare August 17, 2020 08:43
Remove wait() after image generation.
@dvkruchinin dvkruchinin force-pushed the dkru/cypress_test_issue_1785 branch from 1b91a51 to 6ec6556 Compare August 17, 2020 12:36
cy.get('.cvat-draw-shape-popover-content')
.find('button')
.contains('Shape')
.click({force: true})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the argument force: true do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forcing a click overrides the actionable checks Cypress applies and will automatically fire the events.
From Cypress log (without forcing):

Timed out retrying: cy.click() failed because this element:

<span>Shape</span>

has CSS pointer-events: none

pointer-events: none prevents user mouse interaction.

Fix this problem, or use {force: true} to disable error checking.

@bsekachev bsekachev merged commit ec8ebc7 into cvat-ai:develop Aug 17, 2020
@dvkruchinin dvkruchinin deleted the dkru/cypress_test_issue_1785 branch August 19, 2020 11:01
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