@ -8,16 +8,17 @@ import { taskName, labelName } from '../../support/const_canvas3d';
context ( 'Canvas 3D functionality. Interaction with cuboid via sidebar.' , ( ) => {
context ( 'Canvas 3D functionality. Interaction with cuboid via sidebar.' , ( ) => {
const caseId = '78' ;
const caseId = '78' ;
const secondLabel = 'car' ;
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality_2/case_78_canvas3d_functionality_cuboid_label.js' ;
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality_2/case_78_canvas3d_functionality_cuboid_label.js' ;
const cuboidCreationParams = {
const cuboidCreationParams = {
labelName : labelName ,
labelName ,
} ;
} ;
const secondLabel = 'car' ;
const secondLabelAdditionalAttrs = false ;
const secondLabelColorRed = 'ff0000' ;
before ( ( ) => {
before ( ( ) => {
cy . openTask ( taskName )
cy . openTask ( taskName ) ;
cy . addNewLabel ( secondLabel );
cy . addNewLabel ( secondLabel , secondLabelAdditionalAttrs , secondLabelColorRed );
cy . openJob ( ) ;
cy . openJob ( ) ;
cy . wait ( 1000 ) ; // Waiting for the point cloud to display
cy . wait ( 1000 ) ; // Waiting for the point cloud to display
cy . customScreenshot ( '.cvat-canvas3d-perspective' , 'canvas3d_perspective_before_all' ) ;
cy . customScreenshot ( '.cvat-canvas3d-perspective' , 'canvas3d_perspective_before_all' ) ;
@ -46,7 +47,10 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_before_all.png' , 'canvas3d_sideview_activating_cuboid.png' ] ,
[ 'canvas3d_sideview_before_all.png' , 'canvas3d_sideview_activating_cuboid.png' ] ,
[ 'canvas3d_frontview_before_all.png' , 'canvas3d_frontview_activating_cuboid.png' ] ,
[ 'canvas3d_frontview_before_all.png' , 'canvas3d_frontview_activating_cuboid.png' ] ,
] . forEach ( ( [ viewBefore , viewAfterCubiodActivation ] ) => {
] . forEach ( ( [ viewBefore , viewAfterCubiodActivation ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewBefore } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodActivation } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewBefore } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodActivation } ` ,
) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -67,7 +71,10 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_activating_cuboid.png' , 'canvas3d_sideview_change_label_cuboid.png' ] ,
[ 'canvas3d_sideview_activating_cuboid.png' , 'canvas3d_sideview_change_label_cuboid.png' ] ,
[ 'canvas3d_frontview_activating_cuboid.png' , 'canvas3d_frontview_change_label_cuboid.png' ] ,
[ 'canvas3d_frontview_activating_cuboid.png' , 'canvas3d_frontview_change_label_cuboid.png' ] ,
] . forEach ( ( [ viewAfterCubiodActivation , viewAfterCubiodChangeLabel ] ) => {
] . forEach ( ( [ viewAfterCubiodActivation , viewAfterCubiodChangeLabel ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewAfterCubiodActivation } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodChangeLabel } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewAfterCubiodActivation } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodChangeLabel } ` ,
) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -84,7 +91,10 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_change_label_cuboid.png' , 'canvas3d_sideview_lock_cuboid.png' ] ,
[ 'canvas3d_sideview_change_label_cuboid.png' , 'canvas3d_sideview_lock_cuboid.png' ] ,
[ 'canvas3d_frontview_change_label_cuboid.png' , 'canvas3d_frontview_lock_cuboid.png' ] ,
[ 'canvas3d_frontview_change_label_cuboid.png' , 'canvas3d_frontview_lock_cuboid.png' ] ,
] . forEach ( ( [ viewAfterCubiodChangeLabel , viewAfterCubiodLock ] ) => {
] . forEach ( ( [ viewAfterCubiodChangeLabel , viewAfterCubiodLock ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewAfterCubiodChangeLabel } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodLock } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewAfterCubiodChangeLabel } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodLock } ` ,
) ;
} ) ;
} ) ;
cy . get ( '.cvat-object-item-button-lock-enabled' ) . click ( { force : true } ) ; // Unlock the cubiod
cy . get ( '.cvat-object-item-button-lock-enabled' ) . click ( { force : true } ) ; // Unlock the cubiod
cy . get ( '.cvat-object-item-button-lock' ) . should ( 'exist' ) . trigger ( 'mouseout' ) ;
cy . get ( '.cvat-object-item-button-lock' ) . should ( 'exist' ) . trigger ( 'mouseout' ) ;
@ -96,7 +106,10 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_lock_cuboid.png' , 'canvas3d_sideview_unlock_cuboid.png' ] ,
[ 'canvas3d_sideview_lock_cuboid.png' , 'canvas3d_sideview_unlock_cuboid.png' ] ,
[ 'canvas3d_frontview_lock_cuboid.png' , 'canvas3d_frontview_unlock_cuboid.png' ] ,
[ 'canvas3d_frontview_lock_cuboid.png' , 'canvas3d_frontview_unlock_cuboid.png' ] ,
] . forEach ( ( [ viewAfterCubiodLock , viewAfterCubiodUnlock ] ) => {
] . forEach ( ( [ viewAfterCubiodLock , viewAfterCubiodUnlock ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewAfterCubiodLock } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodUnlock } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewAfterCubiodLock } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodUnlock } ` ,
) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -134,7 +147,10 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_unlock_cuboid.png' , 'canvas3d_sideview_hide_cuboid.png' ] ,
[ 'canvas3d_sideview_unlock_cuboid.png' , 'canvas3d_sideview_hide_cuboid.png' ] ,
[ 'canvas3d_frontview_unlock_cuboid.png' , 'canvas3d_frontview_hide_cuboid.png' ] ,
[ 'canvas3d_frontview_unlock_cuboid.png' , 'canvas3d_frontview_hide_cuboid.png' ] ,
] . forEach ( ( [ viewAfterCubiodUnlock , viewAfterCubiodHide ] ) => {
] . forEach ( ( [ viewAfterCubiodUnlock , viewAfterCubiodHide ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewAfterCubiodUnlock } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodHide } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewAfterCubiodUnlock } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodHide } ` ,
) ;
} ) ;
} ) ;
cy . get ( '.cvat-object-item-button-hidden-enabled' ) . click ( { force : true } ) ; // Unhide the cuboid
cy . get ( '.cvat-object-item-button-hidden-enabled' ) . click ( { force : true } ) ; // Unhide the cuboid
cy . customScreenshot ( '.cvat-canvas3d-perspective' , 'canvas3d_perspective_unhide_cuboid' ) ;
cy . customScreenshot ( '.cvat-canvas3d-perspective' , 'canvas3d_perspective_unhide_cuboid' ) ;
@ -150,7 +166,10 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_hide_cuboid.png' , 'canvas3d_sideview_unhide_cuboid.png' ] ,
[ 'canvas3d_sideview_hide_cuboid.png' , 'canvas3d_sideview_unhide_cuboid.png' ] ,
[ 'canvas3d_frontview_hide_cuboid.png' , 'canvas3d_frontview_unhide_cuboid.png' ] ,
[ 'canvas3d_frontview_hide_cuboid.png' , 'canvas3d_frontview_unhide_cuboid.png' ] ,
] . forEach ( ( [ viewAfterCubiodHide , viewAfterCubiodUnhide ] ) => {
] . forEach ( ( [ viewAfterCubiodHide , viewAfterCubiodUnhide ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewAfterCubiodHide } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodUnhide } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewAfterCubiodHide } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodUnhide } ` ,
) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ) ;