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

Cypress. Update case_1. Added check label color. #4045

Merged
Changes from all commits
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 @@ -4,14 +4,14 @@

/// <reference types="cypress" />

context('Create and delete a annotation task', () => {
context('Create and delete a annotation task. Color collision.', () => {
const caseId = '1';
const labelName = `Case ${caseId}`;
const taskName = `New annotation task for ${labelName}`;
const attrName = `Attr for ${labelName}`;
const labelName = 'adaf';
const taskName = `New annotation task for Case ${caseId}`;
const attrName = `Attr for Case ${caseId}`;
const textDefaultValue = 'Some default value for type Text';
const imagesCount = 1;
const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}`;
const imageFileName = 'image_case_1';
const width = 800;
const height = 800;
const posX = 10;
Expand All @@ -21,6 +21,7 @@ context('Create and delete a annotation task', () => {
const archivePath = `cypress/fixtures/${archiveName}`;
const imagesFolder = `cypress/fixtures/${imageFileName}`;
const directoryToArchive = imagesFolder;
const newLabelName = 'adia';

before(() => {
cy.visit('auth/login');
Expand All @@ -29,15 +30,27 @@ context('Create and delete a annotation task', () => {
cy.createZipArchive(directoryToArchive, archivePath);
});

describe(`Testing "${labelName}"`, () => {
it('Create a task', () => {
describe(`Testing "Case ${caseId}"`, () => {
it('Create a task.', () => {
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName);
});

it('Delete the created task', () => {
it('Add a label. Check labels color.', () => {
cy.openTask(taskName);
cy.addNewLabel(newLabelName);
cy.get('.cvat-constructor-viewer-item').first().then((firstLabel) => {
cy.get('.cvat-constructor-viewer-item').last().then((secondLabel) => {
expect(firstLabel.attr('style')).not.equal(secondLabel.attr('style'));
});
});
});

it('Delete the created task.', () => {
cy.goToTaskList();
cy.deleteTask(taskName);
});
it('Deleted task not exist', () => {

it('Deleted task not exist.', () => {
cy.contains('strong', taskName)
.parents('.cvat-tasks-list-item')
.should('have.attr', 'style')
Expand Down