Skip to content

Commit

Permalink
Cypress test for issue 1429 (#2017)
Browse files Browse the repository at this point in the history
* Cypress test for issue 1429

* Rebase. Code refactoring.

Co-authored-by: Dmitry Kruchinin <[email protected]>
  • Loading branch information
dvkruchinin and Dmitry Kruchinin authored Aug 13, 2020
1 parent d664492 commit 8f323cf
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions tests/cypress/integration/issue_1429_check_new_label.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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'

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 shape', () => {
cy.createShape(309, 431, 616, 671)
})
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)
})
})
})

0 comments on commit 8f323cf

Please sign in to comment.