You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.1 KiB
JavaScript
68 lines
2.1 KiB
JavaScript
/*
|
|
* Copyright (C) 2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/// <reference types="cypress" />
|
|
|
|
context('Check if the new label reflects in the options', () => {
|
|
|
|
const issueId = '1429'
|
|
const labelName = `Issue ${issueId}`
|
|
const taskName = `New annotation task for ${labelName}`
|
|
const attrName = `Attr for ${labelName}`
|
|
const textDefaultValue = 'Some default value for type Text'
|
|
const image = `image_${issueId}.png`
|
|
const newLabelName = `New ${labelName}`
|
|
const width = 800
|
|
const height = 800
|
|
const posX = 10
|
|
const posY = 10
|
|
const color = 'gray'
|
|
const createRectangleShape2Points = {
|
|
points: 'By 2 Points',
|
|
type: 'Shape',
|
|
switchLabel: false,
|
|
firstX: 250,
|
|
firstY: 350,
|
|
secondX: 350,
|
|
secondY: 450
|
|
}
|
|
|
|
before(() => {
|
|
cy.visit('auth/login')
|
|
cy.login()
|
|
cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName)
|
|
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image)
|
|
})
|
|
|
|
describe(`Testing issue "${issueId}"`, () => {
|
|
it('Open a task. Open a job', () => {
|
|
cy.openTaskJob(taskName)
|
|
})
|
|
it('Return to task page using browser button "previous page"', () => {
|
|
cy.go('back')
|
|
cy.url().should('include', '/tasks').and('not.contain', '/jobs')
|
|
})
|
|
it('Add new label', () => {
|
|
cy.contains('button', 'Add label').click()
|
|
cy.get('[placeholder="Label name"]').type(newLabelName)
|
|
cy.contains('button', 'Done').click()
|
|
})
|
|
it('Open the job again', () => {
|
|
cy.openJob()
|
|
})
|
|
it('Create a rectangle shape', () => {
|
|
cy.createRectangle(createRectangleShape2Points)
|
|
})
|
|
it('Checking for the new label', () => {
|
|
cy.get('#cvat-objects-sidebar-state-item-1')
|
|
.find('.ant-select-selection')
|
|
.click()
|
|
cy.get('.ant-select-dropdown-menu-item')
|
|
.should('contain', newLabelName)
|
|
})
|
|
})
|
|
})
|