From 29e25abf19f878c45bc59c1cfba75412d665f458 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Mon, 30 Nov 2020 15:10:47 +0300 Subject: [PATCH 01/10] add test --- .../case_22_tag_annotation_mode.js | 81 +++++++++++++++++++ tests/cypress/support/commands.js | 14 ++++ 2 files changed, 95 insertions(+) create mode 100644 tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js diff --git a/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js b/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js new file mode 100644 index 00000000..aaa69acb --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js @@ -0,0 +1,81 @@ +// Copyright (C) 2020 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName, labelName } from '../../support/const'; + +context('Tag annotation mode.', () => { + const caseId = '22'; + + function checkCountFrameTags(countTags) { + cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').should('have.length', countTags); + }; + + function checkVisibleFrameTags(labelName) { + cy.get('.cvat-tag-anntation-sidebar-frame-tags').within(() => { + cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').contains(labelName).should('be.visible'); + }); + }; + + function addTag() { + cy.get('.cvat-tag-annotation-sidebar-buttons').contains('Add tag').click(); + }; + + function skipFrame() { + cy.get('.cvat-tag-annotation-sidebar-buttons').contains('Skip frame').click(); + }; + + function changeCheckboxAutomaticallyGoToNextFrame(value) { + cy.get('.cvat-tag-anntation-sidebar-checkbox-skip-frame').within(() => { + if (value == "check") { + cy.get('[type="checkbox"]').check(); + } else if (value == "uncheck") { + cy.get('[type="checkbox"]').uncheck(); + }; + }); + }; + + before(() => { + cy.openTaskJob(taskName); + }); + + describe(`Testing case "${caseId}"`, () => { + it('Go to tag annotation', () => { + cy.changeWorkspace('Tag annotation', labelName); + cy.checkFrameNum(0); + checkCountFrameTags(0); + }); + + it('Skip frame', () => { + skipFrame(); + cy.checkFrameNum(1); + checkCountFrameTags(0); + cy.goToPreviousFrame(); + cy.checkFrameNum(0); + checkCountFrameTags(0); + }); + + it('Add tag', () => { + addTag(); + cy.checkFrameNum(0); + checkCountFrameTags(1); + checkVisibleFrameTags(labelName); + }); + + it('Set "Automatically go to the next frame" to true and add tag', () => { + cy.goToNextFrame(); + cy.checkFrameNum(1); + checkCountFrameTags(0); + changeCheckboxAutomaticallyGoToNextFrame("check"); + addTag(); + cy.checkFrameNum(2); + checkCountFrameTags(0); + cy.goToPreviousFrame(); + cy.checkFrameNum(1); + checkCountFrameTags(1); + checkVisibleFrameTags(labelName); + }); + }); +}); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 9648b333..0831a7a7 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -490,3 +490,17 @@ Cypress.Commands.add('writeFilterValue', (clear, filterValue) => { cy.get('.ant-select-selection__choice__content').should('have.text', filterValue); }); }); + +Cypress.Commands.add('checkFrameNum', (frameNum) => { + cy.get('.cvat-player-frame-selector').within(() => { + cy.get('input[role="spinbutton"]').should('have.value', frameNum); + }); +}); + +Cypress.Commands.add('goToNextFrame', () => { + cy.get('.cvat-player-next-button').click(); +}); + +Cypress.Commands.add('goToPreviousFrame', () => { + cy.get('.cvat-player-previous-button').click(); +}); From 70809f045b48ca67b1bb2aa2b2a81bb11ffb89a5 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Mon, 30 Nov 2020 15:11:58 +0300 Subject: [PATCH 02/10] add className for elements --- cvat-ui/package-lock.json | 2 +- cvat-ui/package.json | 2 +- .../tag-annotation-sidebar/tag-annotation-sidebar.tsx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 5063901f..9fd70cc3 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.8", + "version": "1.10.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 135d15f0..e555f248 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.8", + "version": "1.10.9", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { diff --git a/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx b/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx index 29fb3a4a..7177c664 100644 --- a/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx +++ b/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx @@ -245,11 +245,12 @@ function TagAnnotationSidebar(props: StateToProps & DispatchToProps): JSX.Elemen - + Frame tags:  {frameTags.map((tag: any) => ( { onRemoveState(tag); From c89161b9f31fe9b80d5ede2213533ac4ca54a54c Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Mon, 30 Nov 2020 16:46:21 +0300 Subject: [PATCH 03/10] medhod frameNum call by changed frame --- .../case_22_tag_annotation_mode.js | 25 +++++++++---------- tests/cypress/support/commands.js | 6 +++-- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js b/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js index aaa69acb..03208d6f 100644 --- a/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js +++ b/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js @@ -10,12 +10,16 @@ context('Tag annotation mode.', () => { const caseId = '22'; function checkCountFrameTags(countTags) { - cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').should('have.length', countTags); + if (countTags == 0) { + cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').should('not.exist'); + } else { + cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').should('have.length', countTags); + }; }; - function checkVisibleFrameTags(labelName) { + function checkPresenceFrameTags(labelName) { cy.get('.cvat-tag-anntation-sidebar-frame-tags').within(() => { - cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').contains(labelName).should('be.visible'); + cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').contains(labelName).should('exist'); }); }; @@ -44,7 +48,6 @@ context('Tag annotation mode.', () => { describe(`Testing case "${caseId}"`, () => { it('Go to tag annotation', () => { cy.changeWorkspace('Tag annotation', labelName); - cy.checkFrameNum(0); checkCountFrameTags(0); }); @@ -52,30 +55,26 @@ context('Tag annotation mode.', () => { skipFrame(); cy.checkFrameNum(1); checkCountFrameTags(0); - cy.goToPreviousFrame(); - cy.checkFrameNum(0); + cy.goToPreviousDefaultFrame(0); checkCountFrameTags(0); }); it('Add tag', () => { addTag(); - cy.checkFrameNum(0); checkCountFrameTags(1); - checkVisibleFrameTags(labelName); + checkPresenceFrameTags(labelName); }); it('Set "Automatically go to the next frame" to true and add tag', () => { - cy.goToNextFrame(); - cy.checkFrameNum(1); + cy.goToNextDefaultFrame(1); checkCountFrameTags(0); changeCheckboxAutomaticallyGoToNextFrame("check"); addTag(); cy.checkFrameNum(2); checkCountFrameTags(0); - cy.goToPreviousFrame(); - cy.checkFrameNum(1); + cy.goToPreviousDefaultFrame(1); checkCountFrameTags(1); - checkVisibleFrameTags(labelName); + checkPresenceFrameTags(labelName); }); }); }); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 0831a7a7..d16e2b15 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -497,10 +497,12 @@ Cypress.Commands.add('checkFrameNum', (frameNum) => { }); }); -Cypress.Commands.add('goToNextFrame', () => { +Cypress.Commands.add('goToNextDefaultFrame', (frameNum) => { cy.get('.cvat-player-next-button').click(); + cy.checkFrameNum(frameNum); }); -Cypress.Commands.add('goToPreviousFrame', () => { +Cypress.Commands.add('goToPreviousDefaultFrame', (frameNum) => { cy.get('.cvat-player-previous-button').click(); + cy.checkFrameNum(frameNum); }); From 4145620481fb406779b24ceaf915dc577caedb0a Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Mon, 30 Nov 2020 16:50:37 +0300 Subject: [PATCH 04/10] rename variable --- tests/cypress/support/commands.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index d16e2b15..edb62ecc 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -497,12 +497,12 @@ Cypress.Commands.add('checkFrameNum', (frameNum) => { }); }); -Cypress.Commands.add('goToNextDefaultFrame', (frameNum) => { +Cypress.Commands.add('goToNextDefaultFrame', (expectedFrameNum) => { cy.get('.cvat-player-next-button').click(); - cy.checkFrameNum(frameNum); + cy.checkFrameNum(expectedFrameNum); }); -Cypress.Commands.add('goToPreviousDefaultFrame', (frameNum) => { +Cypress.Commands.add('goToPreviousDefaultFrame', (expectedFrameNum) => { cy.get('.cvat-player-previous-button').click(); - cy.checkFrameNum(frameNum); + cy.checkFrameNum(expectedFrameNum); }); From e4d6eb314a154a3027cd4b5f9035d38f56ff5ac9 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Mon, 30 Nov 2020 18:07:11 +0300 Subject: [PATCH 05/10] change version cvat-ui --- cvat-ui/package-lock.json | 2 +- cvat-ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 9fd70cc3..3ba1e868 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.9", + "version": "1.10.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index e555f248..0a4083bd 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.10.9", + "version": "1.10.10", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { From 0265313d560ecbe3e043481283b7adfc40b5425d Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Wed, 2 Dec 2020 09:57:27 +0300 Subject: [PATCH 06/10] typos fixed in className --- .../tag-annotation-sidebar/tag-annotation-sidebar.tsx | 4 ++-- .../actions_tasks_objects/case_22_tag_annotation_mode.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx b/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx index 7177c664..c5ee62f1 100644 --- a/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx +++ b/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx @@ -245,12 +245,12 @@ function TagAnnotationSidebar(props: StateToProps & DispatchToProps): JSX.Elemen - + Frame tags:  {frameTags.map((tag: any) => ( { onRemoveState(tag); diff --git a/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js b/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js index 03208d6f..3a8b84a6 100644 --- a/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js +++ b/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js @@ -11,15 +11,15 @@ context('Tag annotation mode.', () => { function checkCountFrameTags(countTags) { if (countTags == 0) { - cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').should('not.exist'); + cy.get('span.cvat-tag-annotation-sidebar-frame-tag-label').should('not.exist'); } else { - cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').should('have.length', countTags); + cy.get('span.cvat-tag-annotation-sidebar-frame-tag-label').should('have.length', countTags); }; }; function checkPresenceFrameTags(labelName) { - cy.get('.cvat-tag-anntation-sidebar-frame-tags').within(() => { - cy.get('span.cvat-tag-anntation-sidebar-frame-tag-label').contains(labelName).should('exist'); + cy.get('.cvat-tag-annotation-sidebar-frame-tags').within(() => { + cy.get('span.cvat-tag-annotation-sidebar-frame-tag-label').contains(labelName).should('exist'); }); }; From 6f1f3f3103e1b7b01c230f8571d56b223077df2c Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Wed, 2 Dec 2020 10:00:42 +0300 Subject: [PATCH 07/10] renamed functions go to another frames --- .../actions_tasks_objects/case_22_tag_annotation_mode.js | 6 +++--- tests/cypress/support/commands.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js b/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js index 3a8b84a6..a68be08a 100644 --- a/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js +++ b/tests/cypress/integration/actions_tasks_objects/case_22_tag_annotation_mode.js @@ -55,7 +55,7 @@ context('Tag annotation mode.', () => { skipFrame(); cy.checkFrameNum(1); checkCountFrameTags(0); - cy.goToPreviousDefaultFrame(0); + cy.goToPreviousFrame(0); checkCountFrameTags(0); }); @@ -66,13 +66,13 @@ context('Tag annotation mode.', () => { }); it('Set "Automatically go to the next frame" to true and add tag', () => { - cy.goToNextDefaultFrame(1); + cy.goToNextFrame(1); checkCountFrameTags(0); changeCheckboxAutomaticallyGoToNextFrame("check"); addTag(); cy.checkFrameNum(2); checkCountFrameTags(0); - cy.goToPreviousDefaultFrame(1); + cy.goToPreviousFrame(1); checkCountFrameTags(1); checkPresenceFrameTags(labelName); }); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index edb62ecc..824be82b 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -497,12 +497,12 @@ Cypress.Commands.add('checkFrameNum', (frameNum) => { }); }); -Cypress.Commands.add('goToNextDefaultFrame', (expectedFrameNum) => { +Cypress.Commands.add('goToNextFrame', (expectedFrameNum) => { cy.get('.cvat-player-next-button').click(); cy.checkFrameNum(expectedFrameNum); }); -Cypress.Commands.add('goToPreviousDefaultFrame', (expectedFrameNum) => { +Cypress.Commands.add('goToPreviousFrame', (expectedFrameNum) => { cy.get('.cvat-player-previous-button').click(); cy.checkFrameNum(expectedFrameNum); }); From 962868831c3532105c62c5a708d242057f5d5c06 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Wed, 2 Dec 2020 11:52:56 +0300 Subject: [PATCH 08/10] fix className for cvat-tag-annotation-sidebar-checkbox-skip-frame element --- .../annotation-page/tag-annotation-workspace/styles.scss | 2 +- .../tag-annotation-sidebar/tag-annotation-sidebar.tsx | 2 +- .../actions_tasks_objects/case_22_tag_annotation_mode.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cvat-ui/src/components/annotation-page/tag-annotation-workspace/styles.scss b/cvat-ui/src/components/annotation-page/tag-annotation-workspace/styles.scss index a647412a..992f5e50 100644 --- a/cvat-ui/src/components/annotation-page/tag-annotation-workspace/styles.scss +++ b/cvat-ui/src/components/annotation-page/tag-annotation-workspace/styles.scss @@ -33,7 +33,7 @@ } .cvat-tag-annotation-sidebar-buttons, -.cvat-tag-anntation-sidebar-checkbox-skip-frame { +.cvat-tag-annotation-sidebar-checkbox-skip-frame { padding-bottom: 15px; } diff --git a/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx b/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx index c5ee62f1..252805e9 100644 --- a/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx +++ b/cvat-ui/src/components/annotation-page/tag-annotation-workspace/tag-annotation-sidebar/tag-annotation-sidebar.tsx @@ -233,7 +233,7 @@ function TagAnnotationSidebar(props: StateToProps & DispatchToProps): JSX.Elemen - + { }; function changeCheckboxAutomaticallyGoToNextFrame(value) { - cy.get('.cvat-tag-anntation-sidebar-checkbox-skip-frame').within(() => { + cy.get('.cvat-tag-annotation-sidebar-checkbox-skip-frame').within(() => { if (value == "check") { cy.get('[type="checkbox"]').check(); } else if (value == "uncheck") { From 55f49bcab4199b5e44c8b4f7171a983e27e25b53 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Wed, 2 Dec 2020 11:53:16 +0300 Subject: [PATCH 09/10] change version cvat-ui --- cvat-ui/package-lock.json | 2 +- cvat-ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 08cea114..59a75dbd 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.11.0", + "version": "1.11.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 4dea1406..35884c24 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.11.0", + "version": "1.11.1", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { From fa0752cbca64748e8f385ec4a3f8e548812be26f Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Wed, 2 Dec 2020 16:06:21 +0300 Subject: [PATCH 10/10] change version --- cvat-ui/package-lock.json | 3 +-- cvat-ui/package.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 0d425685..d213d6a7 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,7 +1,6 @@ { "name": "cvat-ui", - "version": "1.11.1", - "version": "1.11.3", + "version": "1.11.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 69a247b8..b8dda7db 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,7 +1,6 @@ { "name": "cvat-ui", - "version": "1.11.1", - "version": "1.11.3", + "version": "1.11.4", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": {