Merge remote-tracking branch 'upstream/develop' into dkru/cypress_test_case14_appearance_features

main
Kruchinin 5 years ago
commit 4e8d8b6f44

@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated `docker-compose` file version from `2.3` to `3.3`(<https://github.com/openvinotoolkit/cvat/pull/2235>)
- Added auto inference of url schema from host in CLI, if provided (<https://github.com/openvinotoolkit/cvat/pull/2240>)
- Track frames in skips between annotation is presented in MOT and MOTS formats are marked `outside` (<https://github.com/openvinotoolkit/cvat/pull/2198>)
- UI packages installation with `npm ci` instead of `npm install` (<https://github.com/openvinotoolkit/cvat/pull/2350>)
### Deprecated
@ -69,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Cannot read property 'label' of undefined (Fixed?) (<https://github.com/openvinotoolkit/cvat/pull/2311>)
- Excluded track frames marked `outside` in `CVAT for Images` export (<https://github.com/openvinotoolkit/cvat/pull/2345>)
- 'List of tasks' Kibana visualization (<https://github.com/openvinotoolkit/cvat/pull/2361>)
- An error on exporting not `jpg` or `png` images in TF Detection API format (<https://github.com/openvinotoolkit/datumaro/issues/35>)
### Security

@ -67,9 +67,9 @@ patches and features.
- Install npm packages for UI and start UI debug server (run the following command from CVAT root directory):
```sh
npm install && \
cd cvat-core && npm install && \
cd ../cvat-ui && npm install && npm start
npm ci && \
cd cvat-core && npm ci && \
cd ../cvat-ui && npm ci && npm start
```
> Note for Mac users

@ -25,19 +25,19 @@ RUN npm config set loglevel info
# Install cvat-data dependencies
WORKDIR /tmp/cvat-data/
RUN npm install
RUN npm ci
# Install cvat-core dependencies
WORKDIR /tmp/cvat-core/
RUN npm install
RUN npm ci
# Install cvat-canvas dependencies
WORKDIR /tmp/cvat-canvas/
RUN npm install
RUN npm ci
# Install cvat-ui dependencies
WORKDIR /tmp/cvat-ui/
RUN npm install
RUN npm ci
# Build source code
COPY cvat-data/ /tmp/cvat-data/

@ -18,7 +18,7 @@ If you make changes in this package, please do following:
- Dependencies installation
```bash
npm install
npm ci
```
- Building the module from sources in the `dist` directory:

@ -2822,10 +2822,6 @@
},
"cvat-data": {
"version": "file:../cvat-data",
"requires": {
"async-mutex": "^0.2.4",
"jszip": "3.5.0"
},
"dependencies": {
"@babel/cli": {
"version": "7.6.4",
@ -9637,9 +9633,9 @@
}
},
"detect-browser": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/detect-browser/-/detect-browser-5.1.1.tgz",
"integrity": "sha512-5n2aWI57qC3kZaK4j2zYsG6L1LrxgLptGCNhMQgdKhVn6cSdcq43pp6xHPfTHG3TYM6myF4tIPWiZtfdVDgb9w=="
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/detect-browser/-/detect-browser-5.2.0.tgz",
"integrity": "sha512-tr7XntDAu50BVENgQfajMLzacmSe34D+qZc4zjnniz0ZVuw/TZcLcyxHQjYpJTM36sGEkZZlYLnIM1hH7alTMA=="
},
"detect-file": {
"version": "1.0.0",

@ -36,7 +36,7 @@
"axios": "^0.20.0",
"browser-or-node": "^1.2.1",
"cvat-data": "../cvat-data",
"detect-browser": "^5.0.0",
"detect-browser": "^5.2.0",
"error-stack-parser": "^2.0.2",
"form-data": "^2.5.0",
"jest-config": "^24.8.0",

@ -20,7 +20,7 @@ you also need to do `npm install` to update `package-lock.json`
- Installing dependencies:
```bash
cd ../cvat-core && npm install && cd - && npm install
cd ../cvat-core && npm ci && cd - && npm ci
```
- Running development UI server with autorebuild on change

@ -1208,9 +1208,9 @@
"dev": true
},
"@types/react": {
"version": "16.9.51",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.51.tgz",
"integrity": "sha512-lQa12IyO+DMlnSZ3+AGHRUiUcpK47aakMMoBG8f7HGxJT8Yfe+WE128HIXaHOHVPReAW0oDS3KAI0JI2DDe1PQ==",
"version": "16.9.52",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.52.tgz",
"integrity": "sha512-EHRjmnxiNivwhGdMh9sz1Yw9AUxTSZFxKqdBWAAzyZx3sufWwx6ogqHYh/WB1m/I4ZpjkoZLExF5QTy2ekVi/Q==",
"requires": {
"@types/prop-types": "*",
"csstype": "^3.0.2"
@ -12874,7 +12874,6 @@
"requires": {
"axios": "^0.20.0",
"browser-or-node": "^1.2.1",
"cvat-data": "file:../cvat-data",
"detect-browser": "^5.0.0",
"error-stack-parser": "^2.0.2",
"form-data": "^2.5.0",

@ -48,7 +48,7 @@
},
"dependencies": {
"@types/platform": "^1.3.3",
"@types/react": "^16.9.51",
"@types/react": "^16.9.52",
"@types/react-color": "^3.0.4",
"@types/react-dom": "^16.9.0",
"@types/react-redux": "^7.1.2",

@ -44,4 +44,4 @@ tensorflow==2.2.1 # Optional requirement of Datumaro
# archives. Don't use as a python module because it has GPL license.
patool==1.12
diskcache==5.0.2
git+https://github.com/openvinotoolkit/datumaro@v0.1.2
git+https://github.com/openvinotoolkit/datumaro@v0.1.3

@ -0,0 +1,125 @@
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName } from '../../support/const';
context('Merge/split features', () => {
const caseId = '13';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
firstX: 250,
firstY: 350,
secondX: 350,
secondY: 450,
};
const createRectangleShape2PointsSecond = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
firstX: createRectangleShape2Points.firstX + 300,
firstY: createRectangleShape2Points.firstY,
secondX: createRectangleShape2Points.secondX + 300,
secondY: createRectangleShape2Points.secondY,
};
const frameNum = 0;
// Check the 'X' coordinate. 'Y' coordinate is the same.
let xCoordinatesObjectFirstFrame = 0;
let xCoordinatesObjectThirdFrame = 0;
before(() => {
cy.openTaskJob(taskName);
});
function goCheckFrameNumber(frameNum) {
cy.get('.cvat-player-frame-selector').within(() => {
cy.get('input[role="spinbutton"]').clear().type(`${frameNum}{Enter}`).should('have.value', frameNum);
});
}
describe(`Testing case "${caseId}"`, () => {
it('Create rectangle shape on first frame', () => {
goCheckFrameNumber(frameNum);
cy.createRectangle(createRectangleShape2Points);
cy.get('#cvat_canvas_shape_1').should('have.attr', 'x').then(xCoords => {
xCoordinatesObjectFirstFrame = Math.floor(xCoords);
});
});
it('Create rectangle shape on third frame with another position', () => {
goCheckFrameNumber(frameNum + 2);
cy.createRectangle(createRectangleShape2PointsSecond);
cy.get('#cvat_canvas_shape_2').should('have.attr', 'x').then(xCoords => {
xCoordinatesObjectThirdFrame = Math.floor(xCoords);
});
});
it('Merge the objects with "Merge button"', () => {
cy.get('.cvat-merge-control').click();
cy.get('#cvat_canvas_shape_2').click();
goCheckFrameNumber(frameNum);
cy.get('#cvat_canvas_shape_1').click();
cy.get('.cvat-merge-control').click();
});
it('Get a track with keyframes on first and third frame', () => {
cy.get('#cvat_canvas_shape_3').should('exist').and('be.visible');
cy.get('#cvat-objects-sidebar-state-item-3').should('contain', '3').and('contain', 'RECTANGLE TRACK').within(() => {
cy.get('.cvat-object-item-button-keyframe-enabled').should('exist');
});
goCheckFrameNumber(frameNum + 2);
cy.get('#cvat_canvas_shape_3').should('exist').and('be.visible');
cy.get('#cvat-objects-sidebar-state-item-3').should('contain', '3').and('contain', 'RECTANGLE TRACK').within(() => {
cy.get('.cvat-object-item-button-keyframe-enabled').should('exist');
});
});
it('On the second frame and on the fourth frame the track is invisible', () => {
goCheckFrameNumber(frameNum + 1);
cy.get('#cvat_canvas_shape_3').should('exist').and('be.hidden');
goCheckFrameNumber(frameNum + 3);
cy.get('#cvat_canvas_shape_3').should('exist').and('be.hidden');
});
it('Go to the second frame and remove "outside" flag from the track. The track now visible.', () => {
goCheckFrameNumber(frameNum + 1);
cy.get('#cvat-objects-sidebar-state-item-3').should('contain', '3').and('contain', 'RECTANGLE TRACK').within(() => {
cy.get('.cvat-object-item-button-outside').click();
cy.get('.cvat-object-item-button-outside-enabled').should('not.exist');
});
cy.get('#cvat_canvas_shape_3').should('exist').and('be.visible');
});
it('Remove "keyframe" flag from the track. Track now interpolated between position on the first and the third frames.', () => {
cy.get('#cvat-objects-sidebar-state-item-3').should('contain', '3').and('contain', 'RECTANGLE TRACK').within(() => {
cy.get('.cvat-object-item-button-keyframe').click();
cy.get('.cvat-object-item-button-keyframe-enabled').should('not.exist');
});
cy.get('#cvat_canvas_shape_3').should('have.attr', 'x').then(xCoords => {
// expected 9785 to be within 9642..9928
expect(Math.floor(xCoords)).to.be.within(xCoordinatesObjectFirstFrame, xCoordinatesObjectThirdFrame);
});
});
it('On the fourth frame remove "keyframe" flag from the track. The track now visible and "outside" flag is disabled.', () => {
goCheckFrameNumber(frameNum + 3);
cy.get('#cvat-objects-sidebar-state-item-3').should('contain', '3').and('contain', 'RECTANGLE TRACK').within(() => {
cy.get('.cvat-object-item-button-keyframe').click();
cy.get('.cvat-object-item-button-keyframe-enabled').should('not.exist');
cy.get('.cvat-object-item-button-outside-enabled').should('not.exist');
});
cy.get('#cvat_canvas_shape_3').should('exist').and('be.visible');
});
it('Split a track with "split" button. Previous track became invisible (has "outside" flag). One more track and it is visible.', () => {
cy.get('.cvat-split-track-control').click();
// A single click does not reproduce the split a track scenario in cypress test.
cy.get('#cvat_canvas_shape_3').click().click();
cy.get('#cvat_canvas_shape_4').should('exist').and('be.hidden');
cy.get('#cvat-objects-sidebar-state-item-4').should('contain', '4').and('contain', 'RECTANGLE TRACK').within(() => {
cy.get('.cvat-object-item-button-outside-enabled').should('exist');
});
cy.get('#cvat_canvas_shape_5').should('exist').and('be.visible');
cy.get('#cvat-objects-sidebar-state-item-5').should('contain', '5').and('contain', 'RECTANGLE TRACK').within(() => {
cy.get('.cvat-object-item-button-outside-enabled').should('not.exist');
cy.get('.cvat-object-item-button-keyframe-enabled').should('exist');
});
});
});
});

@ -1,8 +1,6 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*/
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
@ -30,12 +28,7 @@ context('The highlighted attribute in AAM should correspond to the chosen attrib
cy.createRectangle(createRectangleShape2Points);
});
it('Go to AAM', () => {
cy.changeAnnotationMode('Attribute annotation');
// Select the necessary label in any case
cy.get('.attribute-annotation-sidebar-basics-editor').within(() => {
cy.get('.ant-select-selection').click();
});
cy.get('.ant-select-dropdown-menu-item').contains(labelName).click();
cy.changeWorkspace('Attribute annotation', labelName);
});
it('Check if highlighted attribute correspond to the chosen attribute in right panel', () => {
cy.get('.cvat_canvas_text').within(() => {

@ -17,11 +17,11 @@ context('Check if the UI not to crash after remove a tag', () => {
describe(`Testing issue "${issueId}"`, () => {
it('Add a tag', () => {
cy.changeAnnotationMode('Tag annotation');
cy.changeWorkspace('Tag annotation');
cy.get('.cvat-tag-annotation-sidebar-buttons').within(() => {
cy.get('button').contains('Add tag').click({ force: true });
});
cy.changeAnnotationMode('Standard');
cy.changeWorkspace('Standard');
});
it('Remove the tag', () => {
cy.get('#cvat-objects-sidebar-state-item-1')

@ -1,8 +1,6 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*/
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
@ -39,11 +37,7 @@ context('An error occurs in AAM when switching to 2 frames, if the frames have o
cy.createRectangle(createRectangleShape2PointsSecond);
});
it('Go to AAM', () => {
cy.get('.cvat-workspace-selector').click();
cy.get('.ant-select-dropdown-menu-item')
.contains('Attribute annotation')
.click()
.should('contain.text', 'Attribute annotation');
cy.changeWorkspace('Attribute annotation', labelName);
});
it('Go to next frame', () => {
cy.get('.cvat-player-next-button').click();
@ -65,6 +59,7 @@ context('An error occurs in AAM when switching to 2 frames, if the frames have o
});
it('Page with the error is missing', () => {
cy.contains('Oops, something went wrong').should('not.exist');
cy.changeLabelAAM(labelName);
cy.get('.attribute-annotation-sidebar-object-switcher').should('contain', `${labelName} 2 [2/2]`);
});
});

@ -16,5 +16,13 @@ module.exports = (on, config) => {
return null;
},
});
// Try to resolve "Cypress failed to make a connection to the Chrome DevTools Protocol"
// https://github.com/cypress-io/cypress/issues/7450
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--disable-gpu');
return launchOptions
}
});
return config;
};

@ -1,8 +1,6 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*/
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
@ -124,10 +122,16 @@ Cypress.Commands.add('switchLabel', (labelName) => {
});
Cypress.Commands.add('checkObjectParameters', (objectParameters, objectType) => {
cy.get('.cvat-objects-sidebar-state-item').then((objectSidebar) => {
cy.get(`#cvat_canvas_shape_${objectSidebar.length}`).should('exist').and('be.visible');
cy.get(`#cvat-objects-sidebar-state-item-${objectSidebar.length}`)
.should('contain', objectSidebar.length).and('contain', `${objectType} ${objectParameters.type.toUpperCase()}`).within(() => {
let listCanvasShapeId = [];
cy.document().then((doc) => {
const listCanvasShape = Array.from(doc.querySelectorAll('.cvat_canvas_shape'));
for (let i = 0; i < listCanvasShape.length; i++) {
listCanvasShapeId.push(listCanvasShape[i].id.match(/\d+$/));
}
const maxId = Math.max(...listCanvasShapeId);
cy.get(`#cvat_canvas_shape_${maxId}`).should('exist').and('be.visible');
cy.get(`#cvat-objects-sidebar-state-item-${maxId}`)
.should('contain', maxId).and('contain', `${objectType} ${objectParameters.type.toUpperCase()}`).within(() => {
cy.get('.ant-select-selection-selected-value').should('have.text', selectedValueGlobal);
});
});
@ -217,10 +221,23 @@ Cypress.Commands.add('closeSettings', () => {
});
});
Cypress.Commands.add('changeAnnotationMode', (mode) => {
Cypress.Commands.add('changeWorkspace', (mode, labelName) => {
cy.get('.cvat-workspace-selector').click();
cy.get('.ant-select-dropdown-menu-item').contains(mode).click();
cy.get('.cvat-workspace-selector').should('contain.text', mode);
cy.changeLabelAAM(labelName);
});
Cypress.Commands.add('changeLabelAAM', (labelName) => {
cy.get('.cvat-workspace-selector').then((value) => {
const cvatWorkspaceSelectorValue = value.text();
if (cvatWorkspaceSelectorValue === 'Attribute annotation') {
cy.get('.attribute-annotation-sidebar-basics-editor').within(() => {
cy.get('.ant-select-selection').click();
});
cy.get('.ant-select-dropdown-menu-item').contains(labelName).click();
}
});
});
Cypress.Commands.add('createCuboid', (createCuboidParams) => {

Loading…
Cancel
Save