@ -8,16 +8,17 @@ import { taskName, labelName } from '../../support/const_canvas3d';
context ( 'Canvas 3D functionality. Interaction with cuboid via sidebar.' , ( ) => {
const caseId = '78' ;
const secondLabel = 'car' ;
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality_2/case_78_canvas3d_functionality_cuboid_label.js' ;
const cuboidCreationParams = {
labelName : labelName ,
labelName ,
} ;
const secondLabel = 'car' ;
const secondLabelAdditionalAttrs = false ;
const secondLabelColorRed = 'ff0000' ;
before ( ( ) => {
cy . openTask ( taskName )
cy . addNewLabel ( secondLabel );
cy . openTask ( taskName ) ;
cy . addNewLabel ( secondLabel , secondLabelAdditionalAttrs , secondLabelColorRed );
cy . openJob ( ) ;
cy . wait ( 1000 ) ; // Waiting for the point cloud to display
cy . customScreenshot ( '.cvat-canvas3d-perspective' , 'canvas3d_perspective_before_all' ) ;
@ -32,7 +33,7 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
cy . get ( '#cvat-objects-sidebar-state-item-1' )
. trigger ( 'mouseover' )
. should ( 'have.class' , 'cvat-objects-sidebar-state-active-item' )
. wait ( 1000 ) ; // Wating for cuboid activation
. wait ( 1000 ) ; // Wating for cuboid activation
cy . customScreenshot ( '.cvat-canvas3d-perspective' , 'canvas3d_perspective_after_activating_cuboid' ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } /canvas3d_perspective_before_all.png ` ,
@ -46,7 +47,10 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_before_all.png' , 'canvas3d_sideview_activating_cuboid.png' ] ,
[ 'canvas3d_frontview_before_all.png' , 'canvas3d_frontview_activating_cuboid.png' ] ,
] . forEach ( ( [ viewBefore , viewAfterCubiodActivation ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewBefore } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodActivation } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewBefore } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodActivation } ` ,
) ;
} ) ;
} ) ;
@ -67,14 +71,17 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_activating_cuboid.png' , 'canvas3d_sideview_change_label_cuboid.png' ] ,
[ 'canvas3d_frontview_activating_cuboid.png' , 'canvas3d_frontview_change_label_cuboid.png' ] ,
] . forEach ( ( [ viewAfterCubiodActivation , viewAfterCubiodChangeLabel ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewAfterCubiodActivation } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodChangeLabel } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewAfterCubiodActivation } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodChangeLabel } ` ,
) ;
} ) ;
} ) ;
it ( 'Lock/unlock a cuboid via sidear. The control points of the cuboid on the top/side/front view are locked/unlocked.' , ( ) => {
cy . get ( '#cvat-objects-sidebar-state-item-1' )
. find ( '.cvat-object-item-button-lock' )
. click ( { force : true } ) ; // Lock the cubiod
. click ( { force : true } ) ; // Lock the cubiod
cy . get ( '.cvat-object-item-button-lock-enabled' ) . should ( 'exist' ) ;
[ 'topview' , 'sideview' , 'frontview' ] . forEach ( ( view ) => {
cy . customScreenshot ( ` .cvat-canvas3d- ${ view } ` , ` canvas3d_ ${ view } _lock_cuboid ` ) ;
@ -84,9 +91,12 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_change_label_cuboid.png' , 'canvas3d_sideview_lock_cuboid.png' ] ,
[ 'canvas3d_frontview_change_label_cuboid.png' , 'canvas3d_frontview_lock_cuboid.png' ] ,
] . 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' ) ;
[ 'topview' , 'sideview' , 'frontview' ] . forEach ( ( view ) => {
cy . customScreenshot ( ` .cvat-canvas3d- ${ view } ` , ` canvas3d_ ${ view } _unlock_cuboid ` ) ;
@ -96,20 +106,23 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_lock_cuboid.png' , 'canvas3d_sideview_unlock_cuboid.png' ] ,
[ 'canvas3d_frontview_lock_cuboid.png' , 'canvas3d_frontview_unlock_cuboid.png' ] ,
] . forEach ( ( [ viewAfterCubiodLock , viewAfterCubiodUnlock ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewAfterCubiodLock } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodUnlock } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewAfterCubiodLock } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodUnlock } ` ,
) ;
} ) ;
} ) ;
it ( 'Switch occluded property for a cuboid via sidear. The cuboid on the perpective view are occluded.' , ( ) => {
cy . get ( '#cvat-objects-sidebar-state-item-1' )
. find ( '.cvat-object-item-button-occluded' )
. click ( { force : true } ) ; // Switch occluded property
. click ( { force : true } ) ; // Switch occluded property
cy . customScreenshot ( '.cvat-canvas3d-perspective' , 'canvas3d_perspective_enable_occlud_cuboid' ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } /canvas3d_perspective_after_activating_cuboid.png ` ,
` ${ screenshotsPath } /canvas3d_perspective_enable_occlud_cuboid.png ` ,
) ;
cy . get ( '.cvat-object-item-button-occluded-enabled' ) . click ( { force : true } ) ; // Switch occluded property again
cy . get ( '.cvat-object-item-button-occluded-enabled' ) . click ( { force : true } ) ; // Switch occluded property again
cy . customScreenshot ( '.cvat-canvas3d-perspective' , 'canvas3d_perspective_disable_occlud_cuboid' ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } /canvas3d_perspective_enable_occlud_cuboid.png ` ,
@ -120,7 +133,7 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
it ( 'Hide/unhide a cuboid via sidear. The cuboid on the perpective/top/side/front view be hidden/unhidden.' , ( ) => {
cy . get ( '#cvat-objects-sidebar-state-item-1' )
. find ( '.cvat-object-item-button-hidden' )
. click ( { force : true } ) ; // Hide the cuboid
. click ( { force : true } ) ; // Hide the cuboid
cy . customScreenshot ( '.cvat-canvas3d-perspective' , 'canvas3d_perspective_hide_cuboid' ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } /canvas3d_perspective_disable_occlud_cuboid.png ` ,
@ -134,9 +147,12 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_unlock_cuboid.png' , 'canvas3d_sideview_hide_cuboid.png' ] ,
[ 'canvas3d_frontview_unlock_cuboid.png' , 'canvas3d_frontview_hide_cuboid.png' ] ,
] . 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 . compareImagesAndCheckResult (
` ${ screenshotsPath } /canvas3d_perspective_hide_cuboid.png ` ,
@ -150,7 +166,10 @@ context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
[ 'canvas3d_sideview_hide_cuboid.png' , 'canvas3d_sideview_unhide_cuboid.png' ] ,
[ 'canvas3d_frontview_hide_cuboid.png' , 'canvas3d_frontview_unhide_cuboid.png' ] ,
] . forEach ( ( [ viewAfterCubiodHide , viewAfterCubiodUnhide ] ) => {
cy . compareImagesAndCheckResult ( ` ${ screenshotsPath } / ${ viewAfterCubiodHide } ` , ` ${ screenshotsPath } / ${ viewAfterCubiodUnhide } ` ) ;
cy . compareImagesAndCheckResult (
` ${ screenshotsPath } / ${ viewAfterCubiodHide } ` ,
` ${ screenshotsPath } / ${ viewAfterCubiodUnhide } ` ,
) ;
} ) ;
} ) ;
} ) ;