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 "Rotated bounding boxes" #3961

Conversation

dvkruchinin
Copy link
Contributor

Related to #3832

Motivation and context

Adding a test to test functionality "Rotated bounding boxes"

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

Comment on lines 43 to 47
if (shift) {
cy.get('.cvat-canvas-container').trigger('mousemove', x, y, { shiftKey: true });
} else {
cy.get('.cvat-canvas-container').trigger('mousemove', x, y);
}
Copy link
Member

Choose a reason for hiding this comment

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

cy.get('.cvat-canvas-container').trigger('mousemove', x, y, { shiftKey: shift });?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


const transformMatrixShape = [];

function testShapeRotate(shape, x, y, expectedRorate, shift) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
function testShapeRotate(shape, x, y, expectedRorate, shift) {
function testShapeRotate(shape, x, y, expectedRotate, shift) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

} else {
cy.get('.cvat-canvas-container').trigger('mousemove', x, y);
}
cy.get('#cvat_canvas_text_content').should('contain.text', expectedRorate);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cy.get('#cvat_canvas_text_content').should('contain.text', expectedRorate);
cy.get('#cvat_canvas_text_content').should('contain.text', expectedRotate);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


it('Check rotation with hold Shift button.', () => {
cy.goCheckFrameNumber(0);
testShapeRotate('#cvat_canvas_shape_1', 350, 150, '13.0°', true);
Copy link
Member

Choose a reason for hiding this comment

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

With shift it is not expected you can rotate to 13 degrees, the nearest is 15 degrees.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

it('Check rotation with hold Shift button.', () => {
cy.goCheckFrameNumber(0);
testShapeRotate('#cvat_canvas_shape_1', 350, 150, '13.0°', true);
testShapeRotate('#cvat_canvas_shape_1', 350, 180, '14.2°', true);
Copy link
Member

Choose a reason for hiding this comment

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

The same comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

// A single click does not reproduce the split a track scenario in cypress test.
cy.get('#cvat_canvas_shape_2').click().click();
cy.get('#cvat_canvas_shape_3').should('have.attr', 'transform').then((shapeTransform) => {
cy.get('#cvat_canvas_shape_4').should('have.attr', 'transform', shapeTransform);
Copy link
Member

Choose a reason for hiding this comment

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

One of shapes (3 or 4) should be invisible. Is it correct to try comparing their attributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is probably normal. It is not necessary to make the shape visible. Or is another check expected here?

}
// Merge tracks
cy.get('.cvat-merge-control').click();
cy.get('#cvat_canvas_shape_2').click();
Copy link
Member

Choose a reason for hiding this comment

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

You didn't merge anything here, just select one existing track, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Thanks. Fixed.
Added merge shapes and verification by analogy with tracks.

@nmanovic nmanovic merged commit 45f9fdc into cvat-ai:develop Dec 2, 2021
sarikaya added a commit to roboduels/cvat that referenced this pull request Dec 4, 2021
…o openvinotoolkit-develop

* 'develop' of https://github.com/openvinotoolkit/cvat: (181 commits)
  Cypress. Update case 105. Add check "Google cloud storage" provider fields. (cvat-ai#3980)
  Cypress. Fix case 108 for Firefox. (cvat-ai#3981)
  update project section (cvat-ai#3979)
  Cypress. Test "Rotated bounding boxes" (cvat-ai#3961)
  Issue deleting (cvat-ai#3952)
  Remove key_file_path field (cvat-ai#3959)
  update the doc for change default hostname or port (cvat-ai#3915)
  CVAT_server. Test for "Project updated time". (cvat-ai#3953)
  fix: cvat/requirements/base.txt to reduce vulnerabilities (cvat-ai#3970)
  Fix notification (cvat-ai#3960)
  Update documentation for China users (cvat-ai#3946)
  Support GCS (cvat-ai#3919)
  Cypress. Update the test for check issue 3810. (cvat-ai#3900)
  Update the documentation about the smooth image option (cvat-ai#3947)
  Project tasks pagination (cvat-ai#3910)
  Update documentation about review mode (cvat-ai#3944)
  Preserve the order of the label attributes in the object item details. (cvat-ai#3945)
  Added smooth image option (cvat-ai#3933)
  Fixed issue: autoborder points are visible for invisible shapes (cvat-ai#3931)
  Add FiftyOne to partners list (cvat-ai#3943)
  ...
sarikaya added a commit to roboduels/cvat that referenced this pull request Dec 4, 2021
* openvinotoolkit-develop: (181 commits)
  Cypress. Update case 105. Add check "Google cloud storage" provider fields. (cvat-ai#3980)
  Cypress. Fix case 108 for Firefox. (cvat-ai#3981)
  update project section (cvat-ai#3979)
  Cypress. Test "Rotated bounding boxes" (cvat-ai#3961)
  Issue deleting (cvat-ai#3952)
  Remove key_file_path field (cvat-ai#3959)
  update the doc for change default hostname or port (cvat-ai#3915)
  CVAT_server. Test for "Project updated time". (cvat-ai#3953)
  fix: cvat/requirements/base.txt to reduce vulnerabilities (cvat-ai#3970)
  Fix notification (cvat-ai#3960)
  Update documentation for China users (cvat-ai#3946)
  Support GCS (cvat-ai#3919)
  Cypress. Update the test for check issue 3810. (cvat-ai#3900)
  Update the documentation about the smooth image option (cvat-ai#3947)
  Project tasks pagination (cvat-ai#3910)
  Update documentation about review mode (cvat-ai#3944)
  Preserve the order of the label attributes in the object item details. (cvat-ai#3945)
  Added smooth image option (cvat-ai#3933)
  Fixed issue: autoborder points are visible for invisible shapes (cvat-ai#3931)
  Add FiftyOne to partners list (cvat-ai#3943)
  ...
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