Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cypress tests for the feature: 'continue frame n' #4340

Merged
merged 3 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function AnnotationPageComponent(props: Props): JSX.Element {
<span>
Press
<Button
className='cvat-continue-job-button'
className='cvat-notification-continue-job-button'
type='link'
onClick={() => {
changeFrame(parsedFrame);
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/src/components/annotation-page/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ button.cvat-predictor-button {
font-weight: bold;
}

.cvat-continue-job-button {
.cvat-notification-continue-job-button {
padding: 0;

> span {
Expand Down
62 changes: 62 additions & 0 deletions tests/cypress/integration/actions_tasks/continue_frame_n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// 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.get('.cvat-player-frame-selector')
bsekachev marked this conversation as resolved.
Show resolved Hide resolved
.find('input[role="spinbutton"]')
.should('have.value', 0);
bsekachev marked this conversation as resolved.
Show resolved Hide resolved
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.get('.cvat-player-frame-selector')
.find('input[role="spinbutton"]')
.should('have.value', 2);
bsekachev marked this conversation as resolved.
Show resolved Hide resolved
});
});
});