-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added cypress tests for the feature: 'continue frame n' (#4340)
* Added cypress tests for the feature: 'continue frame n' * Update tests/cypress/integration/actions_tasks/continue_frame_n.js * Update tests/cypress/integration/actions_tasks/continue_frame_n.js
- Loading branch information
Showing
3 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
tests/cypress/integration/actions_tasks/continue_frame_n.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright (C) 2022 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
context('Paste labels from one task to another.', { browser: '!firefox' }, () => { | ||
const task = { | ||
name: 'Test "Continue frame N"', | ||
label: 'Test label', | ||
attrName: 'Test attribute', | ||
attrValue: 'Test attribute value', | ||
}; | ||
|
||
const imagesCount = 3; | ||
const imageFileName = `image_${task.name.replace(' ', '_').toLowerCase()}`; | ||
const width = 100; | ||
const height = 100; | ||
const posX = 10; | ||
const posY = 10; | ||
const color = 'gray'; | ||
const archiveName = `${imageFileName}.zip`; | ||
const archivePath = `cypress/fixtures/${archiveName}`; | ||
const imagesFolder = `cypress/fixtures/${imageFileName}`; | ||
const directoryToArchive = imagesFolder; | ||
|
||
before(() => { | ||
cy.visit('/'); | ||
cy.login(); | ||
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, task.name, imagesCount); | ||
cy.createZipArchive(directoryToArchive, archivePath); | ||
cy.goToTaskList(); | ||
cy.createAnnotationTask(task.name, task.label, task.attrName, task.attrValue, archiveName); | ||
}); | ||
|
||
after(() => { | ||
cy.logout(); | ||
cy.getAuthKey().then((authKey) => { | ||
cy.deleteTasks(authKey, [task.name, task.nameSecond]); | ||
}); | ||
}); | ||
|
||
describe('Test "Continue frame N"', () => { | ||
it('Open job, go to the 3rd frame, close task, reopen, notification exists.', () => { | ||
cy.openTaskJob(task.name); | ||
cy.checkFrameNum(0); | ||
cy.goCheckFrameNumber(2); | ||
cy.goToTaskList(); | ||
cy.openTaskJob(task.name); | ||
cy.get('.cvat-notification-continue-job').should('exist'); | ||
}); | ||
|
||
it('Pressing continue button should navigate to the latest opened frame', () => { | ||
cy.get('.cvat-notification-continue-job-button').click(); | ||
cy.checkFrameNum(2); | ||
}); | ||
}); | ||
}); |