From b0f4ad68421178e7f39af4dbf5cd334ed821000b Mon Sep 17 00:00:00 2001 From: Kruchinin Date: Mon, 23 Nov 2020 18:00:55 +0300 Subject: [PATCH] Cypress test. Issue 2440 --- ...ssue_2440_value_must_be_a_user_instance.js | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/cypress/integration/actions_users/issue_2440_value_must_be_a_user_instance.js diff --git a/tests/cypress/integration/actions_users/issue_2440_value_must_be_a_user_instance.js b/tests/cypress/integration/actions_users/issue_2440_value_must_be_a_user_instance.js new file mode 100644 index 00000000..8b36c9fb --- /dev/null +++ b/tests/cypress/integration/actions_users/issue_2440_value_must_be_a_user_instance.js @@ -0,0 +1,46 @@ +// Copyright (C) 2020 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName } from '../../support/const'; + +context('Value must be a user instance.', () => { + const issueId = '2440'; + + before(() => { + cy.openTask(taskName); + }); + + describe(`Testing issue "${issueId}"`, () => { + it('Assign a task to a user', () => { + cy.get('.cvat-task-details-user-block').within(() => { + cy.get('.cvat-user-search-field').click(); + }); + cy.get('.ant-select-dropdown') + .not('.ant-select-dropdown-hidden') + .contains(new RegExp(`^${Cypress.env('user')}$`, 'g')) + .click(); + cy.get('.cvat-spinner').should('exist'); + }); + it('Assign the task to the same user again', () => { + cy.get('.cvat-task-details-user-block').within(() => { + cy.get('.cvat-user-search-field').click(); + }); + cy.get('.ant-select-dropdown') + .not('.ant-select-dropdown-hidden') + .contains(new RegExp(`^${Cypress.env('user')}$`, 'g')) + .click(); + // Before fix: + // The following error originated from your application code, not from Cypress. + // > Value must be a user instance + + // Remove the user's assignment for next tests. + cy.get('.cvat-spinner').should('exist'); + cy.get('.cvat-task-details-user-block').within(() => { + cy.get('[type="text"]').click().clear().type('{Enter}'); + }); + }); + }); +});