未验证 提交 156ddae1 编写于 作者: D Dmitry Kruchinin 提交者: GitHub

Cypress tests for CVAT-3D-M5 (#3228)

* CVAT 3D Milestone-5 changes

* Fixed Lint errors

* test

* Fixed review comments

* Fixed Lint errors

* M5 Box operations

* M5- Bounding Box Operations

* M5 Fixes

* Cypress test added wait time

* Changed the scene color to white

* Fixed year in header

* CameraAction naming convention changes

* M5-Fixes

* Fixed test fail issue

* M5- Major fixes

* Trigger notification

* Minor Fixes M5

* M5 - Other open items

* Trigger notification

* Error fix

* Trigger notification

* Unit Test fail fix

* Unit Test fail fix

* Trigger notification

* CVAT-3D M5 Review Fixes -1

* Add cypress test.

* try run canvas3d without headless

* hide tooltips

* Tests adaptations

* Review Fixes -2

* Review Fixes -3

* Merge changes

* Revert case 64

* Revert to cvat-3D-M5

* The test adaptation

* Add comments

* Added wait time in cypress

* Add condition for compare images

* cypress test. cuboid context menu.

* Cypress test. Make a copy.

* Cypress test. Cuboid propagate.

* Cypress test. Opacity. Outlined borders.

Add cypress command. Tests adaptation.

* Cypress test. Cuboid grouping.

* Fixes -1

* Trigger notification

* Case 64 adaptation.

* Updated yml for cypress tests 3D

* Cypress test. Redraw a cuboid.

* Updated tests

* Latest tests

* Cypress test. Cancel cuboid drawning.

* Cypress test. "Move the image" button interaction.

* Cypress test. Delete a cuboid.

* Cypress test. Save a job. Remove annotations.

* Fix case 88

* Fix case 88

* Cypress test. Filters.

* Minor rework case88

* Applying comments.

Co-authored-by: cdp <cdp123>
Co-authored-by: NJayraj <jayrajsolanki96@gmail.com>
上级 cc4b3f31
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Interaction with cuboid via sidebar.', () => {
const caseId = '78';
const secondLabel = 'car';
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality/case_78_canvas3d_functionality_cuboid_label.js';
const cuboidCreationParams = {
labelName: labelName,
};
before(() => {
cy.openTask(taskName)
cy.addNewLabel(secondLabel);
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_before_all');
['topview', 'sideview', 'frontview'].forEach((view) => {
cy.get(`.cvat-canvas3d-${view}`)
.find('.cvat-canvas3d-fullsize')
.screenshot(`canvas3d_${view}_before_all`);
});
cy.create3DCuboid(cuboidCreationParams);
});
describe(`Testing case "${caseId}"`, () => {
it('Activate a cuboid on sidear.', () => {
cy.get('#cvat-objects-sidebar-state-item-1')
.trigger('mouseover')
.should('have.class', 'cvat-objects-sidebar-state-active-item')
.wait(1000); //Wating for cuboid activation
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_after_activating_cuboid');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_before_all.png`,
`${screenshotsPath}/canvas3d_perspective_after_activating_cuboid.png`,
);
['topview', 'sideview', 'frontview'].forEach((view) => {
cy.get(`.cvat-canvas3d-${view}`)
.find('.cvat-canvas3d-fullsize')
.screenshot(`canvas3d_${view}_activating_cuboid`);
});
[
['canvas3d_topview_before_all.png', 'canvas3d_topview_activating_cuboid.png'],
['canvas3d_sideview_before_all.png', 'canvas3d_sideview_activating_cuboid.png'],
['canvas3d_frontview_before_all.png', 'canvas3d_frontview_activating_cuboid.png'],
].forEach(([viewBefore, viewAfterCubiodActivation]) => {
cy.compareImagesAndCheckResult(`${screenshotsPath}/${viewBefore}`, `${screenshotsPath}/${viewAfterCubiodActivation}`);
});
});
it('Change a label via sidear.', () => {
cy.get('#cvat-objects-sidebar-state-item-1')
.find('.cvat-objects-sidebar-state-item-label-selector')
.type(`${secondLabel}{Enter}`)
.trigger('mouseout');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_after_change_label_cuboid');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_after_activating_cuboid.png`,
`${screenshotsPath}/canvas3d_perspective_after_change_label_cuboid.png`,
);
['topview', 'sideview', 'frontview'].forEach((view) => {
cy.get(`.cvat-canvas3d-${view}`)
.find('.cvat-canvas3d-fullsize')
.screenshot(`canvas3d_${view}_change_label_cuboid`);
});
[
['canvas3d_topview_activating_cuboid.png', 'canvas3d_topview_change_label_cuboid.png'],
['canvas3d_sideview_activating_cuboid.png', 'canvas3d_sideview_change_label_cuboid.png'],
['canvas3d_frontview_activating_cuboid.png', 'canvas3d_frontview_change_label_cuboid.png'],
].forEach(([viewAfterCubiodActivation, viewAfterCubiodChangeLabel]) => {
cy.compareImagesAndCheckResult(`${screenshotsPath}/${viewAfterCubiodActivation}`, `${screenshotsPath}/${viewAfterCubiodChangeLabel}`);
});
});
it('Lock/unlock a cuboid via sidear. The control points of the cuboid on the top/side/front view are locked/unlocked.', () => {
cy.get('#cvat-objects-sidebar-state-item-1')
.find('.cvat-object-item-button-lock')
.click(); // Lock the cubiod
cy.get('.cvat-object-item-button-lock-enabled').should('exist').trigger('mouseout');
['topview', 'sideview', 'frontview'].forEach((view) => {
cy.get(`.cvat-canvas3d-${view}`)
.find('.cvat-canvas3d-fullsize')
.screenshot(`canvas3d_${view}_lock_cuboid`);
});
[
['canvas3d_topview_change_label_cuboid.png', 'canvas3d_topview_lock_cuboid.png'],
['canvas3d_sideview_change_label_cuboid.png', 'canvas3d_sideview_lock_cuboid.png'],
['canvas3d_frontview_change_label_cuboid.png', 'canvas3d_frontview_lock_cuboid.png'],
].forEach(([viewAfterCubiodChangeLabel, viewAfterCubiodLock]) => {
cy.compareImagesAndCheckResult(`${screenshotsPath}/${viewAfterCubiodChangeLabel}`, `${screenshotsPath}/${viewAfterCubiodLock}`);
});
cy.get('.cvat-object-item-button-lock-enabled').click(); // Unlock the cubiod
cy.get('.cvat-object-item-button-lock').should('exist').trigger('mouseout');
['topview', 'sideview', 'frontview'].forEach((view) => {
cy.get(`.cvat-canvas3d-${view}`)
.find('.cvat-canvas3d-fullsize')
.screenshot(`canvas3d_${view}_unlock_cuboid`);
});
[
['canvas3d_topview_lock_cuboid.png', 'canvas3d_topview_unlock_cuboid.png'],
['canvas3d_sideview_lock_cuboid.png', 'canvas3d_sideview_unlock_cuboid.png'],
['canvas3d_frontview_lock_cuboid.png', 'canvas3d_frontview_unlock_cuboid.png'],
].forEach(([viewAfterCubiodLock, viewAfterCubiodUnlock]) => {
cy.compareImagesAndCheckResult(`${screenshotsPath}/${viewAfterCubiodLock}`, `${screenshotsPath}/${viewAfterCubiodUnlock}`);
});
});
it('Switch occluded property for a cuboid via sidear. The cuboid on the perpective view are occluded.', () => {
cy.get('#cvat-objects-sidebar-state-item-1')
.find('.cvat-object-item-button-occluded')
.click(); // Switch occluded property
cy.get('.cvat-object-item-button-occluded-enabled').should('exist').trigger('mouseout');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_enable_occlud_cuboid');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_after_activating_cuboid.png`,
`${screenshotsPath}/canvas3d_perspective_enable_occlud_cuboid.png`,
);
cy.get('.cvat-object-item-button-occluded-enabled').click(); // Switch occluded property again
cy.get('.cvat-object-item-button-occluded').should('exist').trigger('mouseout');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_disable_occlud_cuboid');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_enable_occlud_cuboid.png`,
`${screenshotsPath}/canvas3d_perspective_disable_occlud_cuboid.png`,
);
});
it('Hide/unhide a cuboid via sidear. The cuboid on the perpective/top/side/front view be hidden/unhidden.', () => {
cy.get('#cvat-objects-sidebar-state-item-1')
.find('.cvat-object-item-button-hidden')
.click(); // Hide the cuboid
cy.get('.cvat-object-item-button-hidden-enabled').should('exist').trigger('mouseout');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_hide_cuboid');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_disable_occlud_cuboid.png`,
`${screenshotsPath}/canvas3d_perspective_hide_cuboid.png`,
);
['topview', 'sideview', 'frontview'].forEach((view) => {
cy.get(`.cvat-canvas3d-${view}`)
.find('.cvat-canvas3d-fullsize')
.screenshot(`canvas3d_${view}_hide_cuboid`);
});
[
['canvas3d_topview_unlock_cuboid.png', 'canvas3d_topview_hide_cuboid.png'],
['canvas3d_sideview_unlock_cuboid.png', 'canvas3d_sideview_hide_cuboid.png'],
['canvas3d_frontview_unlock_cuboid.png', 'canvas3d_frontview_hide_cuboid.png'],
].forEach(([viewAfterCubiodUnlock, viewAfterCubiodHide]) => {
cy.compareImagesAndCheckResult(`${screenshotsPath}/${viewAfterCubiodUnlock}`, `${screenshotsPath}/${viewAfterCubiodHide}`);
});
cy.get('.cvat-object-item-button-hidden-enabled').click(); // Unhide the cuboid
cy.get('.cvat-object-item-button-hidden').should('exist').trigger('mouseout');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_unhide_cuboid');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_hide_cuboid.png`,
`${screenshotsPath}/canvas3d_perspective_unhide_cuboid.png`,
);
['topview', 'sideview', 'frontview'].forEach((view) => {
cy.get(`.cvat-canvas3d-${view}`)
.find('.cvat-canvas3d-fullsize')
.screenshot(`canvas3d_${view}_unhide_cuboid`);
});
[
['canvas3d_topview_hide_cuboid.png', 'canvas3d_topview_unhide_cuboid.png'],
['canvas3d_sideview_hide_cuboid.png', 'canvas3d_sideview_unhide_cuboid.png'],
['canvas3d_frontview_hide_cuboid.png', 'canvas3d_frontview_unhide_cuboid.png'],
].forEach(([viewAfterCubiodHide, viewAfterCubiodUnhide]) => {
cy.compareImagesAndCheckResult(`${screenshotsPath}/${viewAfterCubiodHide}`, `${screenshotsPath}/${viewAfterCubiodUnhide}`);
});
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Cuboid context menu.', () => {
const caseId = '79';
const cuboidCreationParams = {
labelName: labelName,
};
before(() => {
cy.openTask(taskName)
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
cy.create3DCuboid(cuboidCreationParams);
});
describe(`Testing case "${caseId}"`, () => {
it('Right click on the cuboid. Context menu should exist.', () => {
cy.get('.cvat-canvas3d-perspective').rightclick();
cy.get('.cvat-canvas-context-menu').should('exist');
});
it('Right click outside the cuboid. Context menu should not exist.', () => {
cy.get('.cvat-canvas3d-perspective').click(100, 100);
cy.get('.cvat-canvas-context-menu').should('not.exist');
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Make a copy.', () => {
const caseId = '80';
const secondLabel = 'car';
const cuboidCreationParams = {
labelName: labelName,
};
before(() => {
cy.openTask(taskName)
cy.addNewLabel(secondLabel);
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
cy.create3DCuboid(cuboidCreationParams);
});
describe(`Testing case "${caseId}"`, () => {
it('Change a label and make a copy via sidebar.', () => {
cy.get('#cvat-objects-sidebar-state-item-1')
.find('.cvat-objects-sidebar-state-item-label-selector')
.type(`${secondLabel}{Enter}`)
.trigger('mouseout');
cy.get('#cvat-objects-sidebar-state-item-1')
.find('[aria-label="more"]')
.click();
cy.get('.ant-dropdown-menu').not('.ant-dropdown-menu-hidden').find('[aria-label="copy"]').click();
cy.get('.cvat-canvas3d-perspective').trigger('mousemove', 300, 200).dblclick(300, 200);
cy.get('#cvat-objects-sidebar-state-item-1').invoke('attr', 'style').then((bgColor) => {
cy.get('#cvat-objects-sidebar-state-item-2').should('have.attr', 'style').and('equal', bgColor);
});
});
it('Make a copy via hot keys.', () => {
cy.get('.cvat-canvas3d-perspective').trigger('mousemove', 100, 200).trigger('mousemove', 300, 200);
cy.get('body').type('{Ctrl}c').type('{Ctrl}v');
cy.get('.cvat-canvas3d-perspective').trigger('mousemove', 350, 200).dblclick(350, 200);
cy.get('.cvat-objects-sidebar-state-item').then((sideBarItems) => {
expect(sideBarItems.length).to.be.equal(3);
});
cy.get('#cvat-objects-sidebar-state-item-2').invoke('attr', 'style').then((bgColor) => {
cy.get('#cvat-objects-sidebar-state-item-3').should('have.attr', 'style').and('equal', bgColor);
});
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Cuboid propagate.', () => {
const caseId = '81';
const cuboidCreationParams = {
labelName: labelName,
};
before(() => {
cy.openTask(taskName)
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
cy.create3DCuboid(cuboidCreationParams);
});
describe(`Testing case "${caseId}"`, () => {
it('Cuboid propagate.', () => {
cy.get('#cvat-objects-sidebar-state-item-1')
.find('[aria-label="more"]')
.click();
cy.get('.ant-dropdown-menu').not('.ant-dropdown-menu-hidden').find('[aria-label="block"]').click();
cy.get('.cvat-propagate-confirm-object-on-frames').should('exist');
cy.contains('button', 'Yes').click();
});
it('On a other frames the cuboid should exist.', () => {
cy.get('.cvat-player-next-button').click();
cy.get('#cvat-objects-sidebar-state-item-2').should('exist');
cy.get('.cvat-player-next-button').click();
cy.get('#cvat-objects-sidebar-state-item-3').should('exist');
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Opacity. Outlined borders.', () => {
const caseId = '82';
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality/case_82_canvas3d_functionality_cuboid_opacity_outlined_borders.js';
const cuboidCreationParams = {
labelName: labelName,
x: 250,
y: 250,
};
before(() => {
cy.openTask(taskName)
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
cy.create3DCuboid(cuboidCreationParams);
cy.get('.cvat-canvas3d-perspective').trigger('mousemove').click(); // Deactivate the cuboiud
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_deactivate_cuboid');
});
describe(`Testing case "${caseId}"`, () => {
it('Change opacity to 100. To 0.', () => {
cy.get('.cvat-appearance-opacity-slider').click('right');
cy.get('.cvat-appearance-opacity-slider').find('[role="slider"]').should('have.attr', 'aria-valuenow', 100);
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_opacty_100');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_deactivate_cuboid.png`,
`${screenshotsPath}/canvas3d_perspective_opacty_100.png`,
);
cy.get('.cvat-appearance-opacity-slider').click('left');
cy.get('.cvat-appearance-opacity-slider').find('[role="slider"]').should('have.attr', 'aria-valuenow', 0);
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_opacty_0');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_opacty_100.png`,
`${screenshotsPath}/canvas3d_perspective_opacty_0.png`,
);
});
it('Change selected opacity to 100. To 0.', () => {
cy.get('.cvat-appearance-selected-opacity-slider').click('right');
cy.get('.cvat-appearance-selected-opacity-slider').find('[role="slider"]').should('have.attr', 'aria-valuenow', 100);
cy.get('.cvat-canvas3d-perspective').trigger('mousemove').trigger('mousemove', 250, 250).wait(1000); // Waiting for the cuboid activation
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_selected_opacty_100');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_opacty_100.png`,
`${screenshotsPath}/canvas3d_perspective_selected_opacty_100.png`,
true, // No diff between the images
);
cy.get('.cvat-appearance-selected-opacity-slider').click('left');
cy.get('.cvat-appearance-selected-opacity-slider').find('[role="slider"]').should('have.attr', 'aria-valuenow', 0);
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_selected_opacty_0');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_opacty_0.png`,
`${screenshotsPath}/canvas3d_perspective_selected_opacty_0.png`,
true, // No diff between the images
);
});
it('Enable/disable outlined borders.', () => {
cy.get('.cvat-appearance-outlinded-borders-checkbox').find('[type="checkbox"]').check();
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_enable_outlined_borders');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_enable_outlined_borders.png`,
`${screenshotsPath}/canvas3d_perspective_selected_opacty_0.png`,
);
cy.get('.cvat-appearance-outlinded-borders-checkbox').find('[type="checkbox"]').uncheck();
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_disable_outlined_borders');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_disable_outlined_borders.png`,
`${screenshotsPath}/canvas3d_perspective_selected_opacty_0.png`,
true, // No diff between the images
);
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Grouping.', () => {
const caseId = '83';
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality/case_83_canvas3d_functionality_cuboid_grouping.js';
const firstCuboidCreationParams = {
labelName: labelName,
x: 350,
y: 250,
};
const secondCuboidCreationParams = {
labelName: labelName,
x: 450,
y: 250,
};
const thirdCuboidCreationParams = {
labelName: labelName,
x: 450,
y: 350,
};
const fourthCuboidCreationParams = {
labelName: labelName,
x: 350,
y: 350,
};
const yellowHex = 'fcbe03';
const yellowRgb = '252, 190, 3';
const shapeSidebarItemArray = ['#cvat-objects-sidebar-state-item-2', '#cvat-objects-sidebar-state-item-3'];
function changeGroupColor(object, color) {
cy.get(object).within(() => {
cy.get('[aria-label="more"]').click();
});
cy.wait(300);
cy.get('.ant-dropdown')
.not('.ant-dropdown-hidden')
.within(() => {
cy.contains('Change group color').click();
});
cy.changeColorViaBadge(color);
}
before(() => {
cy.openTask(taskName)
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
cy.create3DCuboid(firstCuboidCreationParams);
cy.create3DCuboid(secondCuboidCreationParams);
cy.create3DCuboid(thirdCuboidCreationParams);
cy.create3DCuboid(fourthCuboidCreationParams);
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_cuboid_creation');
});
describe(`Testing case "${caseId}"`, () => {
it('Grouping two cuboids.', () => {
cy.get('.cvat-group-control').click();
cy.get('.cvat-canvas3d-perspective').trigger('mousemove', 450, 250).click(450, 250);
cy.get('.cvat-canvas3d-perspective').trigger('mousemove', 450, 350).click(450, 350);
cy.get('.cvat-group-control').click();
cy.changeAppearance('Group');
cy.get('#cvat-objects-sidebar-state-item-1').invoke('attr', 'style').then((bgColorItem1) => {
cy.get('#cvat-objects-sidebar-state-item-4').invoke('attr', 'style').then((bgColorItem4) => {
expect(bgColorItem1).to.be.equal(bgColorItem4);
});
cy.get('#cvat-objects-sidebar-state-item-2').invoke('attr', 'style').then((bgColorItem2) => {
expect(bgColorItem1).not.be.equal(bgColorItem2);
});
cy.get('#cvat-objects-sidebar-state-item-3').invoke('attr', 'style').then((bgColorItem3) => {
expect(bgColorItem1).not.be.equal(bgColorItem3);
});
});
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_cuboid_grouping');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_cuboid_creation.png`,
`${screenshotsPath}/canvas3d_perspective_cuboid_grouping.png`,
);
});
it('Change group color.', () => {
changeGroupColor('#cvat-objects-sidebar-state-item-2', yellowHex);
cy.get('.cvat-label-color-picker').should('be.hidden');
for (const groupedSidebarItemShape of shapeSidebarItemArray) {
cy.get(groupedSidebarItemShape)
.should('have.attr', 'style')
.and('contain', `background-color: rgba(${yellowRgb}`);
}
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_change_group_color');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_cuboid_grouping.png`,
`${screenshotsPath}/canvas3d_perspective_change_group_color.png`,
);
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Redraw.', () => {
const caseId = '84';
const cuboidCreationParams = {
labelName: labelName,
};
before(() => {
cy.openTask(taskName)
cy.openJob();
cy.create3DCuboid(cuboidCreationParams);
});
describe(`Testing case "${caseId}"`, () => {
it('Redraw a cuboid.', () => {
cy.get('.cvat-canvas3d-perspective').trigger('mousemove');
cy.get('body').type('{Shift}n');
cy.get('.cvat-canvas3d-perspective').trigger('mousemove', 450, 250).dblclick(450, 250);
cy.get('.cvat-objects-sidebar-state-item').then((sidebarStateItems) => {
expect(sidebarStateItems.length).to.be.equal(1);
});
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Cancel drawing.', () => {
const caseId = '85';
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality/case_85_canvas3d_functionality_cuboid_сancel_drawing.js';
before(() => {
cy.openTask(taskName)
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
});
describe(`Testing case "${caseId}"`, () => {
it('Cancel drawing.', () => {
cy.get('.cvat-draw-cuboid-control').trigger('mouseover');
cy.get('.cvat-draw-cuboid-popover-visible').find('[type="search"]').click({ force: true });
cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden')
.within(() => {
cy.contains(new RegExp(`^${labelName}$`)).click();
});
cy.get('.cvat-draw-cuboid-popover-visible').find('button').click();
cy.get('.cvat-canvas3d-perspective').trigger('mousemove');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_drawning');
cy.get('body').type('{Esc}');
cy.get('.cvat-active-canvas-control').should('exist');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_cancel_drawning');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_drawning.png`,
`${screenshotsPath}/canvas3d_perspective_cancel_drawning.png`,
);
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. "Move the image" button interaction.', () => {
const caseId = '86';
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality/case_86_canvas3d_functionality_move_image_button.js';
const cuboidCreationParams = {
labelName: labelName,
};
before(() => {
cy.openTask(taskName)
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
cy.create3DCuboid(cuboidCreationParams);
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_after_add_cuboid');
['topview', 'sideview', 'frontview'].forEach((view) => {
cy.get(`.cvat-canvas3d-${view}`)
.find('.cvat-canvas3d-fullsize')
.screenshot(`canvas3d_${view}_after_add_cuboid`);
});
});
describe(`Testing case "${caseId}"`, () => {
it('Click to "Move the image" button. The cuboid on the top/side/front view should be hidden.', () => {
cy.get('.cvat-move-control').click();
cy.get('.cvat-canvas3d-perspective').trigger('mousemove', 300, 200); // Interacting with the canvas before interacting with the cuboid.
cy.get('.cvat-canvas3d-perspective').trigger('mousemove');
cy.get('#cvat-objects-sidebar-state-item-1').should('not.have.class', 'cvat-objects-sidebar-state-active-item');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_move_the_image_clicked');
['topview', 'sideview', 'frontview'].forEach((view) => {
cy.get(`.cvat-canvas3d-${view}`)
.find('.cvat-canvas3d-fullsize')
.screenshot(`canvas3d_${view}_move_the_image_clicked`);
});
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_after_add_cuboid.png`,
`${screenshotsPath}/canvas3d_perspective_move_the_image_clicked.png`,
);
[
['canvas3d_topview_after_add_cuboid.png', 'canvas3d_topview_move_the_image_clicked.png'],
['canvas3d_sideview_after_add_cuboid.png', 'canvas3d_sideview_move_the_image_clicked.png'],
['canvas3d_frontview_after_add_cuboid.png', 'canvas3d_frontview_move_the_image_clicked.png'],
].forEach(([viewAfterAddCuboid, viewMoveTheImageClicked]) => {
cy.compareImagesAndCheckResult(
`${screenshotsPath}/${viewAfterAddCuboid}`,
`${screenshotsPath}/${viewMoveTheImageClicked}`,
);
});
});
it('Cancel "Move the image" activity. "Cursor" button should be active.', () => {
cy.get('body').type('{Esc}');
cy.get('.cvat-active-canvas-control').should('exist');
cy.get('.cvat-canvas3d-perspective').trigger('mousemove', 300, 200); // Interacting with the canvas before interacting with the cuboid.
cy.get('.cvat-canvas3d-perspective').trigger('mousemove');
cy.get('#cvat-objects-sidebar-state-item-1').should('have.class', 'cvat-objects-sidebar-state-active-item');
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Delete a cuboid.', () => {
const caseId = '87';
const cuboidCreationParams = {
labelName: labelName,
};
before(() => {
cy.openTask(taskName)
cy.openJob();
cy.create3DCuboid(cuboidCreationParams);
});
describe(`Testing case "${caseId}"`, () => {
it('Delete a cuboid.', () => {
cy.get('.cvat-canvas3d-perspective').trigger('mousemove', 300, 200).click(300, 200); // Deactivate the cuboid
cy.get('#cvat-objects-sidebar-state-item-1').should('not.have.class', 'cvat-objects-sidebar-state-active-item');
cy.get('.cvat-canvas3d-perspective').trigger('mousemove');
cy.get('#cvat-objects-sidebar-state-item-1').should('have.class', 'cvat-objects-sidebar-state-active-item');
cy.get('body').type('{Del}');
cy.get('#cvat-objects-sidebar-state-item-1').should('not.exist');
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Save a job. Remove annotations.', () => {
const caseId = '88';
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality/case_88_canvas3d_functionality_save_job_remove_annotation.js';
const cuboidCreationParams = {
labelName: labelName,
};
before(() => {
cy.openTask(taskName)
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
cy.get('.cvat-canvas3d-topview').find('.cvat-canvas3d-fullsize').screenshot('canvas3d_topview_before_all');
cy.create3DCuboid(cuboidCreationParams);
});
describe(`Testing case "${caseId}"`, () => {
it('Save a job. Reopen the job.', () => {
cy.saveJob('PATCH', 200, 'saveJob');
cy.goToTaskList();
cy.openTaskJob(taskName);
cy.wait(1000); // Waiting for the point cloud to display
cy.get('.cvat-objects-sidebar-state-item').then((sidebarStateItem) => {
expect(sidebarStateItem.length).to.be.equal(1);
});
cy.get('.cvat-canvas3d-topview').find('.cvat-canvas3d-fullsize').screenshot('canvas3d_topview_after_reopen_job');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_topview_before_all.png`,
`${screenshotsPath}/canvas3d_topview_after_reopen_job.png`,
);
});
it('Remove annotations. Save the job.', () => {
cy.removeAnnotations();
cy.saveJob('PUT');
cy.contains('Saving changes on the server').should('be.hidden');
cy.get('.cvat-objects-sidebar-state-item').should('not.exist');
cy.get('.cvat-canvas3d-topview').find('.cvat-canvas3d-fullsize').screenshot('canvas3d_topview_after_remove_annotations');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_topview_after_reopen_job.png`,
`${screenshotsPath}/canvas3d_topview_after_remove_annotations.png`,
);
});
});
});
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const_canvas3d';
context('Canvas 3D functionality. Filters.', () => {
const caseId = '89';
const secondLabel = 'car'
const screenshotsPath = 'cypress/screenshots/canvas3d_functionality/case_89_canvas3d_functionality_filters.js';
const firstCuboidCreationParams = {
labelName: labelName,
x: 350,
y: 250,
};
const secondCuboidCreationParams = {
labelName: secondLabel,
x: 450,
y: 250,
};
before(() => {
cy.openTask(taskName)
cy.addNewLabel(secondLabel);
cy.openJob();
cy.wait(1000); // Waiting for the point cloud to display
cy.create3DCuboid(firstCuboidCreationParams);
cy.create3DCuboid(secondCuboidCreationParams);
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_after_add_cuboids');
});
describe(`Testing case "${caseId}"`, () => {
it('Set filter "label=points cloud"', () => {
cy.addFiltersRule(0);
cy.setFilter({
groupIndex: 0,
ruleIndex: 0,
field: 'Label',
operator: '==',
value: labelName,
submit: true,
});
cy.get('#cvat-objects-sidebar-state-item-1').should('exist');
cy.get('#cvat-objects-sidebar-state-item-2').should('not.exist');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_set_filter_label');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_after_add_cuboids.png`,
`${screenshotsPath}/canvas3d_perspective_set_filter_label.png`,
);
cy.clearFilters();
});
it('Set filter "ObjectID=2"', () => {
cy.addFiltersRule(0);
cy.setFilter({
groupIndex: 0,
ruleIndex: 0,
field: 'ObjectID',
operator: '==',
value: '2',
submit: true,
});
cy.get('#cvat-objects-sidebar-state-item-1').should('not.exist');
cy.get('#cvat-objects-sidebar-state-item-2').should('exist');
cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_set_filter_objectid');
cy.compareImagesAndCheckResult(
`${screenshotsPath}/canvas3d_perspective_set_filter_objectid.png`,
`${screenshotsPath}/canvas3d_perspective_set_filter_label.png`,
);
cy.clearFilters();
});
});
});
......@@ -36,6 +36,8 @@ Cypress.Commands.add('collectRuleID', () => {
Cypress.Commands.add('clearFilters', () => {
cy.сheckFiltersModalOpened();
cy.contains('button', 'Clear filters').click();
cy.get('.cvat-filters-modal-visible').should('not.exist');
cy.get('.cvat-filters-modal').should('be.hidden');
});
Cypress.Commands.add('addFiltersGroup', (groupIndex) => {
......@@ -117,9 +119,13 @@ Cypress.Commands.add(
if (valueSource) {
cy.get('.ant-dropdown').not('.ant-dropdown-hidden').contains('[role="menuitem"]', value).click();
}
cy.get('.cvat-filters-modal').within(() => {
submit ? cy.contains('button', 'Submit').click() : null;
if (submit) {
cy.get('.cvat-filters-modal-visible').within(() => {
cy.contains('button', 'Submit').click();
});
cy.get('.cvat-filters-modal-visible').should('not.exist');
cy.get('.cvat-filters-modal').should('be.hidden');
}
});
});
},
......@@ -133,7 +139,9 @@ Cypress.Commands.add('selectFilterValue', (filterValue) => {
.within(() => {
cy.contains('[role="menuitem"]', new RegExp(`^${filterValue}$`)).click();
});
cy.get('.cvat-filters-modal').within(() => {
cy.get('.cvat-filters-modal-visible').within(() => {
cy.contains('button', 'Submit').click();
});
cy.get('.cvat-filters-modal-visible').should('not.exist');
cy.get('.cvat-filters-modal').should('be.hidden');
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册