Skip to content

Commit

Permalink
Cypress test. Canvas3D. Add check a context image. (#2966)
Browse files Browse the repository at this point in the history
* Add check a context image

Update zip archive with the pcd files structure.

* Uncomment after()
  • Loading branch information
dvkruchinin authored Mar 17, 2021
1 parent 83a08cb commit c58074e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ context('Canvas 3D functionality. Basic actions.', () => {
compareImages(`${screenshotNameBefore}.png`, `${screenshotNameAfter}.png`);
}

function testContextImage() {
cy.get('.cvat-contextImage-show').should('exist').and('be.visible');
cy.get('[data-icon="camera"]').click(); // Context image hide
cy.get('.cvat-contextImage-show').should('not.exist');
cy.get('[data-icon="camera"]').click(); // Context image show
}

before(() => {
cy.openTaskJob(taskName);
});
Expand Down Expand Up @@ -119,25 +126,28 @@ context('Canvas 3D functionality. Basic actions.', () => {
it('Interaction with the frame change buttons.', () => {
cy.get('.cvat-player-last-button').click();
cy.checkFrameNum(2);
cy.get('.cvat-player-filename-wrapper').should('contain.text', 'generated_pcd_50000_points.pcd');
cy.get('.cvat-player-filename-wrapper').should('contain.text', '000003.pcd');
testContextImage(); // Check context image on the last frame
cy.get('.cvat-player-first-button').click();
cy.checkFrameNum(0);
cy.get('.cvat-player-filename-wrapper').should('contain.text', 'generated_pcd_100000_points.pcd');
cy.get('.cvat-player-filename-wrapper').should('contain.text', '000001.pcd');
testContextImage(); // Check context image on the firts frame
cy.get('.cvat-player-forward-button').click();
cy.checkFrameNum(2);
cy.get('.cvat-player-filename-wrapper').should('contain.text', 'generated_pcd_50000_points.pcd');
cy.get('.cvat-player-filename-wrapper').should('contain.text', '000003.pcd');
cy.get('.cvat-player-backward-button').click();
cy.checkFrameNum(0);
cy.get('.cvat-player-filename-wrapper').should('contain.text', 'generated_pcd_100000_points.pcd');
cy.get('.cvat-player-filename-wrapper').should('contain.text', '000001.pcd');
cy.get('.cvat-player-next-button').click();
cy.checkFrameNum(1);
cy.get('.cvat-player-filename-wrapper').should('contain.text', 'generated_pcd_10000_points.pcd');
cy.get('.cvat-player-filename-wrapper').should('contain.text', '000002.pcd');
testContextImage(); // Check context image on the second frame
cy.get('.cvat-player-previous-button').click();
cy.checkFrameNum(0);
cy.get('.cvat-player-filename-wrapper').should('contain.text', 'generated_pcd_100000_points.pcd');
cy.get('.cvat-player-filename-wrapper').should('contain.text', '000001.pcd');
cy.get('.cvat-player-play-button').click();
cy.checkFrameNum(2);
cy.get('.cvat-player-filename-wrapper').should('contain.text', 'generated_pcd_50000_points.pcd');
cy.get('.cvat-player-filename-wrapper').should('contain.text', '000003.pcd');
cy.get('.cvat-player-first-button').click(); // Return to first frame
});

Expand Down

0 comments on commit c58074e

Please sign in to comment.