From 0856be00e97370a9a102c3b0f505b5e39f821e86 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Wed, 12 Aug 2020 15:37:56 +0300 Subject: [PATCH] Cypress test for issue 1870 (#2016) * Cypress test for issue 1870 * Applying comments. Refactoring the test code. Co-authored-by: Dmitry Kruchinin --- .../issue_1870_cursor_not_jump_to_end.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/cypress/integration/issue_1870_cursor_not_jump_to_end.js diff --git a/tests/cypress/integration/issue_1870_cursor_not_jump_to_end.js b/tests/cypress/integration/issue_1870_cursor_not_jump_to_end.js new file mode 100644 index 00000000..e44ea21c --- /dev/null +++ b/tests/cypress/integration/issue_1870_cursor_not_jump_to_end.js @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + */ + +/// + +context('Checks that the cursor doesn\'t automatically jump to the end of a word when the attribute value changes', () => { + + const issueId = '1870' + const labelName = `Issue ${issueId}` + const taskName = `New annotation task for ${labelName}` + const attrName = `Attr for ${labelName}` + const textDefaultValue = 'text' + const image = `image_${issueId}.png` + const newLabelAttrValue = 'teeext' + 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) + cy.openTaskJob(taskName) + cy.createShape(309, 431, 616, 671) + }) + + describe(`Testing issue "${issueId}"`, () => { + it('Enter 2 characters in the middle of the word attribute value and check the result', () => { + cy.get('#cvat-objects-sidebar-state-item-1') + .find('.ant-collapse-item') + .click() + .find('.cvat-object-item-text-attribute') + .type('{leftarrow}{leftarrow}ee') + .should('have.value', newLabelAttrValue) + }) + }) +})