From f14a92896a7db5d5c8bbd546932693858e3bf658 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Thu, 21 Jan 2021 15:09:42 +0300 Subject: [PATCH 1/6] Fix remove filter fail Firefox browser. (#2700) --- tests/cypress/support/commands.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 4a1d494f5f13..399f9221b014 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -1,4 +1,4 @@ -// Copyright (C) 2020 Intel Corporation +// Copyright (C) 2020-2021 Intel Corporation // // SPDX-License-Identifier: MIT @@ -523,7 +523,7 @@ Cypress.Commands.add('getScaleValue', () => { Cypress.Commands.add('writeFilterValue', (clear, filterValue) => { if (clear) { cy.get('.cvat-annotations-filters-input').within(() => { - cy.get('.ant-select-selection-item-remove').click(); + cy.get('[aria-label="close-circle"]').click(); }); } cy.get('.cvat-annotations-filters-input') @@ -536,7 +536,7 @@ Cypress.Commands.add('writeFilterValue', (clear, filterValue) => { Cypress.Commands.add('selectFilterValue', (clear, filterValue) => { if (clear) { cy.get('.cvat-annotations-filters-input').within(() => { - cy.get('.ant-select-selection-item-remove').click(); + cy.get('[aria-label="close-circle"]').click(); }); } cy.get('body').click(); From 3ced77ccc6065ab57c64a50fba81bc16573d5d40 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Thu, 21 Jan 2021 17:04:18 +0300 Subject: [PATCH 2/6] Cypress test. Add/delete labels and attributes. (#2693) * Cypress test. Add/delete labels and attributes. * Apply comments. --- .../case_41_add_delete_label_attribute.js | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 tests/cypress/integration/actions_tasks_objects/case_41_add_delete_label_attribute.js diff --git a/tests/cypress/integration/actions_tasks_objects/case_41_add_delete_label_attribute.js b/tests/cypress/integration/actions_tasks_objects/case_41_add_delete_label_attribute.js new file mode 100644 index 000000000000..82db7dae033c --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/case_41_add_delete_label_attribute.js @@ -0,0 +1,71 @@ +// Copyright (C) 2021 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +context('Add/delete labels and attributes.', () => { + const caseId = '41'; + const labelName = `Case ${caseId}`; + const attrName = `Attr for ${labelName}`; + const textDefaultValue = 'Some default value for type Text'; + + before(() => { + cy.visit('auth/login'); + cy.login(); + cy.get('#cvat-create-task-button').click(); + }); + + describe(`Testing "${labelName}"`, () => { + it('Start adding a label. Press Cancel. The label is not created.', () => { + cy.get('.cvat-constructor-viewer-new-item').click(); // Open label constructor + cy.get('[placeholder="Label name"]').type(labelName); + cy.contains('[type="button"]', 'Cancel').click(); + cy.get('.cvat-constructor-viewer-item').should('not.exist'); + }); + + it('Start adding a label. Start adding an attribute. Press Cancel. The label is not created.', () => { + cy.get('.cvat-constructor-viewer-new-item').click(); + cy.get('[placeholder="Label name"]').type(labelName); + cy.get('.cvat-new-attribute-button').click(); + cy.get('.cvat-attribute-name-input').type(attrName); + cy.get('.cvat-attribute-type-input').click(); + cy.get('.cvat-attribute-type-input-text').click(); + cy.get('.cvat-attribute-values-input').type(textDefaultValue); + cy.contains('[type="button"]', 'Cancel').click(); + cy.get('.cvat-constructor-viewer-item').should('not.exist'); + }); + + it('Start adding a label. Add an attribute. Press Done. The label should be created.', () => { + cy.get('.cvat-constructor-viewer-new-item').click(); + cy.get('[placeholder="Label name"]').type(labelName); + cy.get('.cvat-new-attribute-button').click(); + cy.get('.cvat-attribute-name-input').type(attrName); + cy.get('.cvat-attribute-type-input').click(); + cy.get('.cvat-attribute-type-input-text').click(); + cy.get('.cvat-attribute-values-input').type(textDefaultValue); + cy.contains('[type="submit"]', 'Done').click(); + cy.get('.cvat-constructor-viewer-item').should('exist'); + }); + + it('Start to edit the label. Attribute should exist. Remove the atrribute. Press Done.', () => { + cy.get('.cvat-constructor-viewer-item').find('[aria-label="edit"]').click(); + cy.get('.cvat-attribute-inputs-wrapper') + .should('exist') + .within(() => { + cy.get('.cvat-delete-attribute-button').click(); + }); + cy.get('.cvat-attribute-inputs-wrapper').should('not.exist'); + cy.contains('[type="submit"]', 'Done').click(); + // After deleting the attribute and saving the changes, check that the attribute is missing. + cy.get('.cvat-constructor-viewer-item').find('[aria-label="edit"]').click(); + cy.get('.cvat-attribute-inputs-wrapper').should('not.exist'); + cy.contains('[type="button"]', 'Cancel').click(); + }); + + it('Delete the added label. The label removed.', () => { + cy.get('.cvat-constructor-viewer-item').find('[aria-label="close"]').click(); + cy.get('.cvat-constructor-viewer-item').should('not.exist'); + }); + }); +}); From f3c00a2f6e7ec4649a02c08d67f68404d8473928 Mon Sep 17 00:00:00 2001 From: Nikita Manovich Date: Mon, 25 Jan 2021 10:36:37 +0300 Subject: [PATCH 3/6] fix: upgrade @types/react-redux from 7.1.14 to 7.1.15 (#2709) Snyk has created this PR to upgrade @types/react-redux from 7.1.14 to 7.1.15. See this package in npm: https://www.npmjs.com/package/@types/react-redux See this project in Snyk: https://app.snyk.io/org/cvat/project/c1f463ee-3776-44c4-b0fa-cd2254d0a094?utm_source=github&utm_medium=upgrade-pr Co-authored-by: snyk-bot --- cvat-ui/package-lock.json | 6 +++--- cvat-ui/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 1044a1c0a71c..bc5df02787b3 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1276,9 +1276,9 @@ } }, "@types/react-redux": { - "version": "7.1.14", - "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.14.tgz", - "integrity": "sha512-WItBNJRC8N/HsgKFXxX8t9NjUY1vv3YTzj9m8HvmaaYRTgy3hgZMIs5ZWAJHQ58nISSakIvS6T91nhJV4iBuaA==", + "version": "7.1.15", + "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.15.tgz", + "integrity": "sha512-+piY42tUflPfI7y9Vy3UkG6MEMuJlrxfdtgeUcWmd5Z0qB57NXAPG6smkqu1DNXluo/KDyXPeRYhcFzMwt1BEA==", "requires": { "@types/hoist-non-react-statics": "^3.3.0", "@types/react": "*", diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 039d98ee1e20..424c538af067 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -53,7 +53,7 @@ "@types/react": "^16.14.2", "@types/react-color": "^3.0.4", "@types/react-dom": "^16.9.10", - "@types/react-redux": "^7.1.14", + "@types/react-redux": "^7.1.15", "@types/react-router": "^5.1.9", "@types/react-router-dom": "^5.1.7", "@types/react-share": "^3.0.3", From c62949b3fc43850c6a3d6250d2ba8334be09177b Mon Sep 17 00:00:00 2001 From: Nikita Manovich Date: Mon, 25 Jan 2021 10:45:02 +0300 Subject: [PATCH 4/6] fix: upgrade @types/lodash from 4.14.166 to 4.14.167 (#2710) Snyk has created this PR to upgrade @types/lodash from 4.14.166 to 4.14.167. See this package in npm: https://www.npmjs.com/package/@types/lodash See this project in Snyk: https://app.snyk.io/org/cvat/project/c1f463ee-3776-44c4-b0fa-cd2254d0a094?utm_source=github&utm_medium=upgrade-pr Co-authored-by: snyk-bot --- cvat-ui/package-lock.json | 6 +++--- cvat-ui/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index bc5df02787b3..2b863d789d3f 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1217,9 +1217,9 @@ "dev": true }, "@types/lodash": { - "version": "4.14.166", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.166.tgz", - "integrity": "sha512-A3YT/c1oTlyvvW/GQqG86EyqWNrT/tisOIh2mW3YCgcx71TNjiTZA3zYZWA5BCmtsOTXjhliy4c4yEkErw6njA==" + "version": "4.14.167", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.167.tgz", + "integrity": "sha512-w7tQPjARrvdeBkX/Rwg95S592JwxqOjmms3zWQ0XZgSyxSLdzWaYH3vErBhdVS/lRBX7F8aBYcYJYTr5TMGOzw==" }, "@types/minimatch": { "version": "3.0.3", diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 424c538af067..f852b8b495f8 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -48,7 +48,7 @@ }, "dependencies": { "@ant-design/icons": "^4.3.0", - "@types/lodash": "^4.14.166", + "@types/lodash": "^4.14.167", "@types/platform": "^1.3.3", "@types/react": "^16.14.2", "@types/react-color": "^3.0.4", From c1a11b1de539ca9aca75848a1406a299337e4688 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Mon, 25 Jan 2021 14:02:08 +0300 Subject: [PATCH 5/6] Cypress test. Annotation filters help window. (#2701) * Add css class to annotation filters help window. * Add cypress test. Annotation filters help window. * Change context * Some changes. --- .../annotations-filters-input.tsx | 1 + .../issue_2690_filters_help_window.js | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/cypress/integration/actions_tasks_objects/issue_2690_filters_help_window.js diff --git a/cvat-ui/src/components/annotation-page/annotations-filters-input.tsx b/cvat-ui/src/components/annotation-page/annotations-filters-input.tsx index 922763916ee0..0d701df32294 100644 --- a/cvat-ui/src/components/annotation-page/annotations-filters-input.tsx +++ b/cvat-ui/src/components/annotation-page/annotations-filters-input.tsx @@ -146,6 +146,7 @@ function AnnotationsFiltersInput(props: StateToProps & DispatchToProps): JSX.Ele width: 700, title: 'How to use filters?', content: filtersHelpModalContent(searchForwardShortcut, searchBackwardShortcut), + className: 'cvat-annotations-filters-help-modal-window', }); }} onMouseEnter={() => setDropdownVisible(false)} diff --git a/tests/cypress/integration/actions_tasks_objects/issue_2690_filters_help_window.js b/tests/cypress/integration/actions_tasks_objects/issue_2690_filters_help_window.js new file mode 100644 index 000000000000..3cd00cad5ee9 --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/issue_2690_filters_help_window.js @@ -0,0 +1,33 @@ +// Copyright (C) 2021 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName } from '../../support/const'; + +context('Annotation filter help dialog window.', () => { + const issueId = '2690'; + + before(() => { + cy.openTaskJob(taskName); + }); + + describe(`Testing issue "${issueId}"`, () => { + it('Open annotation filters help dialog window. The window is visible.', () => { + cy.get('.cvat-annotations-filters-input').within(() => { + // class="ant-select-selection-placeholder" has CSS pointer-events: none + cy.get('.ant-select-selection-placeholder').invoke('css', 'pointer-events', 'auto'); // Replace CSS "pointer-events" to auto + cy.get('[aria-label="filter"]').click(); + }); + cy.get('.cvat-annotations-filters-help-modal-window').should('exist').and('be.visible'); + }); + + it('Close annotation filters help dialog window. The window is closed.', () => { + cy.get('.cvat-annotations-filters-help-modal-window').within(() => { + cy.contains('button', 'OK').click(); + }); + cy.get('.cvat-annotations-filters-help-modal-window').should('not.exist'); + }); + }); +}); From 165cf0fe5b8d59e18a501f010b0d092520e08f63 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Tue, 26 Jan 2021 10:29:24 +0300 Subject: [PATCH 6/6] Cypress test. Creating a label with existing label name. (#2705) --- ...3_create_label_with_existing_label_name.js | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/cypress/integration/actions_tasks_objects/case_43_create_label_with_existing_label_name.js diff --git a/tests/cypress/integration/actions_tasks_objects/case_43_create_label_with_existing_label_name.js b/tests/cypress/integration/actions_tasks_objects/case_43_create_label_with_existing_label_name.js new file mode 100644 index 000000000000..198f77889868 --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/case_43_create_label_with_existing_label_name.js @@ -0,0 +1,34 @@ +// Copyright (C) 2021 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName } from '../../support/const'; + +context('Creating a label with existing label name.', () => { + const caseId = '43'; + let firstLabelName = ''; + + before(() => { + cy.openTask(taskName); + }); + + describe(`Testing case "${caseId}"`, () => { + it('Try to create a label with existing name. Should not be successful.', () => { + // Get the name of the first existing label. + cy.get('.cvat-constructor-viewer-item') + .first() + .then((firstLabel) => { + firstLabelName = firstLabel.text(); + // Try to create a label with existing label name + cy.get('.cvat-constructor-viewer-new-item').click(); + cy.get('[placeholder="Label name"]').type(firstLabelName); + cy.contains('[type="submit"]', 'Done').click(); + }); + cy.get('.cvat-notification-notice-update-task-failed') + .should('exist') + .and('contain.text', 'label names must be unique'); + }); + }); +});