Skip to content

Commit

Permalink
Update cypress test. Canvas 3D functionality. Basic actions. (#3112)
Browse files Browse the repository at this point in the history
* Rename, add css class

* Update cypress test.
  • Loading branch information
dvkruchinin authored Apr 21, 2021
1 parent adbc74f commit be9e00f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2020-2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -56,7 +56,8 @@
.cvat-issue-control,
.cvat-tools-control,
.cvat-extra-controls-control,
.cvat-opencv-control {
.cvat-opencv-control,
.cvat-context-image-control {
border-radius: 3.3px;
transform: scale(0.65);
padding: 2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function PhotoContextControl(props: Props): JSX.Element {
return (
<CVATTooltip title='Photo context show/hide' placement='right'>
<CameraIcon
className={`cvat-move-control
className={`cvat-context-image-control
cvat-control-side-bar-icon-size ${
activeControl === ActiveControl.PHOTO_CONTEXT ? 'cvat-active-canvas-control' : ''
}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ context('Canvas 3D functionality. Basic actions.', () => {
cy.get('[data-icon="camera"]').click(); // Context image show
}

function testControlButtonTooltip(button, expectedTooltipText) {
cy.get(button).trigger('mouseover');
cy.contains(expectedTooltipText).should('exist').and('be.visible'); // Check tooltip
cy.get(button).trigger('mouseout');
cy.contains(expectedTooltipText).should('not.exist');
}

before(() => {
cy.openTaskJob(taskName);
});
Expand Down Expand Up @@ -97,15 +104,25 @@ context('Canvas 3D functionality. Basic actions.', () => {
cy.get('.cvat-canvas3d-topview').should('exist').and('be.visible');
cy.get('.cvat-canvas3d-sideview').should('exist').and('be.visible');
cy.get('.cvat-canvas3d-frontview').should('exist').and('be.visible');
cy.get('.cvat-canvas-controls-sidebar').find('[role="img"]').then(($controlButtons) => {
expect($controlButtons.length).to.be.equal(4);
});
cy.get('.cvat-canvas-controls-sidebar')
.should('exist')
.and('be.visible')
.within(() => {
cy.get('.cvat-move-control').should('exist').and('be.visible');
cy.get('.cvat-cursor-control').should('exist').and('be.visible');
cy.get('.cvat-draw-cuboid-control').should('exist').and('be.visible');
cy.get('[aria-label="camera"]').should('exist').and('be.visible');
cy.get('.cvat-context-image-control').should('exist').and('be.visible');
});
[
['.cvat-move-control', 'Move the image'],
['.cvat-cursor-control', 'Cursor [Esc]'],
['.cvat-context-image-control', 'Photo context show/hide']
].forEach(([button, tooltip]) => {
testControlButtonTooltip(button, tooltip);
});
});

it('Check workspace selector.', () => {
Expand Down

0 comments on commit be9e00f

Please sign in to comment.