|
|
|
@ -1,9 +1,11 @@
|
|
|
|
// Copyright (C) 2020-2021 Intel Corporation
|
|
|
|
// Copyright (C) 2020-2022 Intel Corporation
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
|
|
|
|
/// <reference types="cypress" />
|
|
|
|
/// <reference types="cypress" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* eslint-disable no-loop-func */
|
|
|
|
|
|
|
|
|
|
|
|
import { taskName, labelName } from '../../support/const';
|
|
|
|
import { taskName, labelName } from '../../support/const';
|
|
|
|
|
|
|
|
|
|
|
|
context('Group features', () => {
|
|
|
|
context('Group features', () => {
|
|
|
|
@ -11,7 +13,7 @@ context('Group features', () => {
|
|
|
|
const createRectangleShape2Points = {
|
|
|
|
const createRectangleShape2Points = {
|
|
|
|
points: 'By 2 Points',
|
|
|
|
points: 'By 2 Points',
|
|
|
|
type: 'Shape',
|
|
|
|
type: 'Shape',
|
|
|
|
labelName: labelName,
|
|
|
|
labelName,
|
|
|
|
firstX: 250,
|
|
|
|
firstX: 250,
|
|
|
|
firstY: 350,
|
|
|
|
firstY: 350,
|
|
|
|
secondX: 350,
|
|
|
|
secondX: 350,
|
|
|
|
@ -20,7 +22,7 @@ context('Group features', () => {
|
|
|
|
const createRectangleShape2PointsSecond = {
|
|
|
|
const createRectangleShape2PointsSecond = {
|
|
|
|
points: 'By 2 Points',
|
|
|
|
points: 'By 2 Points',
|
|
|
|
type: 'Shape',
|
|
|
|
type: 'Shape',
|
|
|
|
labelName: labelName,
|
|
|
|
labelName,
|
|
|
|
firstX: createRectangleShape2Points.firstX + 300,
|
|
|
|
firstX: createRectangleShape2Points.firstX + 300,
|
|
|
|
firstY: createRectangleShape2Points.firstY,
|
|
|
|
firstY: createRectangleShape2Points.firstY,
|
|
|
|
secondX: createRectangleShape2Points.secondX + 300,
|
|
|
|
secondX: createRectangleShape2Points.secondX + 300,
|
|
|
|
@ -29,7 +31,7 @@ context('Group features', () => {
|
|
|
|
const createRectangleTrack2Points = {
|
|
|
|
const createRectangleTrack2Points = {
|
|
|
|
points: 'By 2 Points',
|
|
|
|
points: 'By 2 Points',
|
|
|
|
type: 'Track',
|
|
|
|
type: 'Track',
|
|
|
|
labelName: labelName,
|
|
|
|
labelName,
|
|
|
|
firstX: 250,
|
|
|
|
firstX: 250,
|
|
|
|
firstY: 600,
|
|
|
|
firstY: 600,
|
|
|
|
secondX: 350,
|
|
|
|
secondX: 350,
|
|
|
|
@ -38,7 +40,7 @@ context('Group features', () => {
|
|
|
|
const createRectangleTrack2PointsSecond = {
|
|
|
|
const createRectangleTrack2PointsSecond = {
|
|
|
|
points: 'By 2 Points',
|
|
|
|
points: 'By 2 Points',
|
|
|
|
type: 'Track',
|
|
|
|
type: 'Track',
|
|
|
|
labelName: labelName,
|
|
|
|
labelName,
|
|
|
|
firstX: createRectangleTrack2Points.firstX + 300,
|
|
|
|
firstX: createRectangleTrack2Points.firstX + 300,
|
|
|
|
firstY: createRectangleTrack2Points.firstY,
|
|
|
|
firstY: createRectangleTrack2Points.firstY,
|
|
|
|
secondX: createRectangleTrack2Points.secondX + 300,
|
|
|
|
secondX: createRectangleTrack2Points.secondX + 300,
|
|
|
|
@ -75,7 +77,11 @@ context('Group features', () => {
|
|
|
|
for (const shapeToGroup of objectsArray) {
|
|
|
|
for (const shapeToGroup of objectsArray) {
|
|
|
|
cy.get(shapeToGroup).click().should('have.class', 'cvat_canvas_shape_grouping');
|
|
|
|
cy.get(shapeToGroup).click().should('have.class', 'cvat_canvas_shape_grouping');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cancelGrouping ? cy.get('body').type('{Esc}') : cy.get('.cvat-group-control').click();
|
|
|
|
if (cancelGrouping) {
|
|
|
|
|
|
|
|
cy.get('body').type('{Esc}');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
cy.get('.cvat-group-control').click();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function testUnGroupObjects() {
|
|
|
|
function testUnGroupObjects() {
|
|
|
|
@ -119,9 +125,11 @@ context('Group features', () => {
|
|
|
|
cy.get(objectSideBarShape)
|
|
|
|
cy.get(objectSideBarShape)
|
|
|
|
.should('have.css', 'background-color')
|
|
|
|
.should('have.css', 'background-color')
|
|
|
|
.then(($bColorobjectSideBarShape) => {
|
|
|
|
.then(($bColorobjectSideBarShape) => {
|
|
|
|
// expected rgba(250, 50, 83, 0.533) to not include [ 224, 224, 224, index: 4, input: 'rgb(224, 224, 224)', groups: undefined ]
|
|
|
|
// expected rgba(250, 50, 83, 0.533) to not include
|
|
|
|
|
|
|
|
// [ 224, 224, 224, index: 4, input: 'rgb(224, 224, 224)', groups: undefined ]
|
|
|
|
expect($bColorobjectSideBarShape).to.not.contain(defaultGroupColorRgb.match(/\d+, \d+, \d+/));
|
|
|
|
expect($bColorobjectSideBarShape).to.not.contain(defaultGroupColorRgb.match(/\d+, \d+, \d+/));
|
|
|
|
// expected rgba(250, 50, 83, 0.533) to include [ 250, 50, 83, index: 4, input: 'rgb(250, 50, 83)', groups: undefined ]
|
|
|
|
// expected rgba(250, 50, 83, 0.533) to include
|
|
|
|
|
|
|
|
// [ 250, 50, 83, index: 4, input: 'rgb(250, 50, 83)', groups: undefined ]
|
|
|
|
expect($bColorobjectSideBarShape).to.be.contain(shapesGroupColor.match(/\d+, \d+, \d+/));
|
|
|
|
expect($bColorobjectSideBarShape).to.be.contain(shapesGroupColor.match(/\d+, \d+, \d+/));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -151,7 +159,8 @@ context('Group features', () => {
|
|
|
|
cy.get($listObjectsSidebarStateItem[i])
|
|
|
|
cy.get($listObjectsSidebarStateItem[i])
|
|
|
|
.should('have.css', 'background-color')
|
|
|
|
.should('have.css', 'background-color')
|
|
|
|
.then(($bColorObjectsSidebarStateItem) => {
|
|
|
|
.then(($bColorObjectsSidebarStateItem) => {
|
|
|
|
// expected rgba(224, 224, 224, 0.533) to include [ 224, 224, 224, index: 4, input: 'rgb(224, 224, 224)', groups: undefined ]
|
|
|
|
// expected rgba(224, 224, 224, 0.533) to include
|
|
|
|
|
|
|
|
// [ 224, 224, 224, index: 4, input: 'rgb(224, 224, 224)', groups: undefined ]
|
|
|
|
expect($bColorObjectsSidebarStateItem).contain(defaultGroupColorRgb.match(/\d+, \d+, \d+/));
|
|
|
|
expect($bColorObjectsSidebarStateItem).contain(defaultGroupColorRgb.match(/\d+, \d+, \d+/));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -191,9 +200,11 @@ context('Group features', () => {
|
|
|
|
cy.get(objectSideBarTrack)
|
|
|
|
cy.get(objectSideBarTrack)
|
|
|
|
.should('have.css', 'background-color')
|
|
|
|
.should('have.css', 'background-color')
|
|
|
|
.then(($bColorobjectSideBarTrack) => {
|
|
|
|
.then(($bColorobjectSideBarTrack) => {
|
|
|
|
// expected rgba(52, 209, 183, 0.533) to not include [ 224, 224, 224, index: 4, input: 'rgb(224, 224, 224)', groups: undefined ]
|
|
|
|
// expected rgba(52, 209, 183, 0.533) to not include
|
|
|
|
|
|
|
|
// [ 224, 224, 224, index: 4, input: 'rgb(224, 224, 224)', groups: undefined ]
|
|
|
|
expect($bColorobjectSideBarTrack).to.not.contain(defaultGroupColorRgb.match(/\d+, \d+, \d+/));
|
|
|
|
expect($bColorobjectSideBarTrack).to.not.contain(defaultGroupColorRgb.match(/\d+, \d+, \d+/));
|
|
|
|
// expected rgba(52, 209, 183, 0.533) to include [ 52, 209, 183, index: 4, input: 'rgb(52, 209, 183)', groups: undefined ]
|
|
|
|
// expected rgba(52, 209, 183, 0.533) to include
|
|
|
|
|
|
|
|
// [ 52, 209, 183, index: 4, input: 'rgb(52, 209, 183)', groups: undefined ]
|
|
|
|
expect($bColorobjectSideBarTrack).to.be.contain(tracksGroupColor.match(/\d+, \d+, \d+/));
|
|
|
|
expect($bColorobjectSideBarTrack).to.be.contain(tracksGroupColor.match(/\d+, \d+, \d+/));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -205,7 +216,6 @@ context('Group features', () => {
|
|
|
|
cy.removeAnnotations();
|
|
|
|
cy.removeAnnotations();
|
|
|
|
cy.saveJob('PUT');
|
|
|
|
cy.saveJob('PUT');
|
|
|
|
cy.reload();
|
|
|
|
cy.reload();
|
|
|
|
cy.closeModalUnsupportedPlatform();
|
|
|
|
|
|
|
|
cy.get('.cvat-canvas-container').should('exist');
|
|
|
|
cy.get('.cvat-canvas-container').should('exist');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|