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. Remove annotation before spec if an object exist. #2787

Conversation

dvkruchinin
Copy link
Contributor

Motivation and context

Remove the annotation before running the test body if any object already exists. This can help in the case of a failed test in which the work is being saved but the annotation was not removed due to the failure of the previous test steps.

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) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@bsekachev bsekachev self-assigned this Feb 10, 2021
@bsekachev bsekachev self-requested a review February 10, 2021 09:25
@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 69.808% when pulling 4dada0d on dvkruchinin:dkru/remove-annotation-before-each-test-if-object-exist into 44a504e on openvinotoolkit:develop.

@@ -124,17 +124,26 @@ Cypress.Commands.add('getJobNum', (jobID) => {
});
});

Cypress.Commands.add('openJob', (jobID = 0) => {
Cypress.Commands.add('openJob', (jobID = 0, removeAnnotations = true) => {
Copy link
Member

Choose a reason for hiding this comment

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

Just suggestion to make working with arguments possibly easier:

 Cypress.Commands.add('openJob', ({jobID, removeAnnotations} = {}) => { 
    const $jobID = jobID || 0;  // default value
    const $removeAnnotations = removeAnnotations || true; // default value

    ...
});

You can call the command in any ways:

cy.openJob();
cy.openJob({ removeAnnotations: false });
cy.openJob({ jobID: 0 });

and you do not have to remember order of arguments

Sure, it is more applicable when you have a lot of arguments.

@bsekachev bsekachev merged commit 51c3dd8 into cvat-ai:develop Feb 10, 2021
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