Merge branch 'develop' into mk/share_without_copying_
commit
d52d5baab4
@ -0,0 +1,3 @@
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
@ -0,0 +1,148 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { taskName } from '../../support/const';
|
||||
|
||||
context('Filters functionality.', () => {
|
||||
const caseId = '18';
|
||||
const labelShape = 'shape 3 points';
|
||||
const additionalAttrsLabelShape = [
|
||||
{ additionalAttrName: 'type', additionalValue: 'shape', typeAttribute: 'Text' },
|
||||
{ additionalAttrName: 'count points', additionalValue: '3', typeAttribute: 'Text' },
|
||||
{ additionalAttrName: 'polygon', additionalValue: 'True', typeAttribute: 'Checkbox' },
|
||||
];
|
||||
const labelTrack = 'track 4 points';
|
||||
const additionalAttrsLabelTrack = [
|
||||
{ additionalAttrName: 'type', additionalValue: 'track', typeAttribute: 'Text' },
|
||||
{ additionalAttrName: 'polygon', additionalValue: 'True', typeAttribute: 'Checkbox' },
|
||||
{ additionalAttrName: 'count points', additionalValue: '4', typeAttribute: 'Text' },
|
||||
];
|
||||
|
||||
const createPolygonShape = {
|
||||
reDraw: false,
|
||||
type: 'Shape',
|
||||
labelName: labelShape,
|
||||
pointsMap: [
|
||||
{ x: 200, y: 200 },
|
||||
{ x: 250, y: 200 },
|
||||
{ x: 250, y: 240 },
|
||||
],
|
||||
complete: true,
|
||||
numberOfPoints: null,
|
||||
};
|
||||
const createRectangleTrack2Points = {
|
||||
points: 'By 2 Points',
|
||||
type: 'Track',
|
||||
labelName: labelTrack,
|
||||
firstX: 260,
|
||||
firstY: 200,
|
||||
secondX: 360,
|
||||
secondY: 250,
|
||||
};
|
||||
const createRectangleShape4Points = {
|
||||
points: 'By 4 Points',
|
||||
type: 'Shape',
|
||||
labelName: labelShape,
|
||||
firstX: 550,
|
||||
firstY: 350,
|
||||
secondX: 650,
|
||||
secondY: 350,
|
||||
thirdX: 650,
|
||||
thirdY: 450,
|
||||
fourthX: 550,
|
||||
fourthY: 450,
|
||||
};
|
||||
const createPolygonTrack = {
|
||||
reDraw: false,
|
||||
type: 'Track',
|
||||
labelName: labelTrack,
|
||||
pointsMap: [
|
||||
{ x: 700, y: 350 },
|
||||
{ x: 850, y: 350 },
|
||||
{ x: 850, y: 450 },
|
||||
{ x: 700, y: 450 },
|
||||
],
|
||||
numberOfPoints: 4,
|
||||
};
|
||||
|
||||
let cvatCanvasShapeList = [];
|
||||
|
||||
function checkingFilterApplication(ids) {
|
||||
for (let i = 0; i < cvatCanvasShapeList.length; i++) {
|
||||
if (ids.indexOf(cvatCanvasShapeList[i]) > -1) {
|
||||
cy.get(`#cvat_canvas_shape_${cvatCanvasShapeList[i]}`).should('exist');
|
||||
cy.get(`#cvat-objects-sidebar-state-item-${cvatCanvasShapeList[i]}`).should('exist');
|
||||
} else {
|
||||
cy.get(`#cvat_canvas_shape_${cvatCanvasShapeList[i]}`).should('not.exist');
|
||||
cy.get(`#cvat-objects-sidebar-state-item-${cvatCanvasShapeList[i]}`).should('not.exist');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
before(() => {
|
||||
cy.openTask(taskName);
|
||||
cy.addNewLabel(labelShape, additionalAttrsLabelShape);
|
||||
cy.addNewLabel(labelTrack, additionalAttrsLabelTrack);
|
||||
cy.openJob();
|
||||
});
|
||||
|
||||
describe(`Testing case "${caseId}"`, () => {
|
||||
it('Draw several objects (different shapes, tracks, labels)', () => {
|
||||
cy.createPolygon(createPolygonShape);
|
||||
cy.createRectangle(createRectangleTrack2Points);
|
||||
cy.createRectangle(createRectangleShape4Points);
|
||||
cy.createPolygon(createPolygonTrack);
|
||||
cy.get('.cvat_canvas_shape').then(($cvatCanvasShapeList) => {
|
||||
for (let i = 0; i < $cvatCanvasShapeList.length; i++) {
|
||||
cvatCanvasShapeList.push(Number($cvatCanvasShapeList[i].id.match(/\d+$/)));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('Filter: shape=="polygon". Only the polygon exist.', () => {
|
||||
cy.writeFilterValue(false, 'shape=="polygon"'); // #cvat_canvas_shape_1,4, #cvat-objects-sidebar-state-item-1,4
|
||||
checkingFilterApplication([1, 4]);
|
||||
});
|
||||
it('Filter: shape=="polygon" | shape=="rectangle". Only the rectangle and polygon exist.', () => {
|
||||
cy.writeFilterValue(true, 'shape=="polygon" | shape=="rectangle"'); // #cvat_canvas_shape_1,2,3,4, #cvat-objects-sidebar-state-item-1,2,3,4
|
||||
checkingFilterApplication([1, 2, 3, 4]);
|
||||
});
|
||||
it('Filter: type=="shape". Only the objects with shape type exist.', () => {
|
||||
cy.writeFilterValue(true, 'type=="shape"'); // #cvat_canvas_shape_1,3, #cvat-objects-sidebar-state-item-1,3
|
||||
checkingFilterApplication([1, 3]);
|
||||
});
|
||||
it('Filter: label=="track 4 points". Only the polygon exist.', () => {
|
||||
cy.writeFilterValue(true, `label=="${labelTrack}"`); // #cvat_canvas_shape_2,4, #cvat-objects-sidebar-state-item-2,4
|
||||
checkingFilterApplication([2, 4]);
|
||||
});
|
||||
it('Filter: attr["count points"] == "4". Only the objects with same attr exist.', () => {
|
||||
cy.writeFilterValue(true, 'attr["count points"] == "4"'); // #cvat_canvas_shape_2,4, #cvat-objects-sidebar-state-item-2,4
|
||||
checkingFilterApplication([2, 4]);
|
||||
});
|
||||
it('Filter: width >= height. All objects exist.', () => {
|
||||
cy.writeFilterValue(true, 'width >= height'); // #cvat_canvas_shape_1,2,3,4, #cvat-objects-sidebar-state-item-1,2,3,4
|
||||
checkingFilterApplication([1, 2, 3, 4]);
|
||||
});
|
||||
it('Filter: clientID == 4. Only the objects with same id exist (polygon track).', () => {
|
||||
cy.writeFilterValue(true, 'clientID == 4'); // #cvat_canvas_shape_7, #cvat-objects-sidebar-state-item-4
|
||||
checkingFilterApplication([4]);
|
||||
});
|
||||
it('Filter: (label=="shape 3 points" & attr["polylines"]==true) | (label=="track 4 points" & width > 60). Only the objects polygon and rectangle exist.', () => {
|
||||
cy.writeFilterValue(
|
||||
true,
|
||||
'(label=="shape 3 points" & attr["polylines"]==true) | (label=="track 4 points" & width > 60)',
|
||||
); // #cvat_canvas_shape_2,4, #cvat-objects-sidebar-state-item-2,4
|
||||
checkingFilterApplication([2, 4]);
|
||||
});
|
||||
it('Filter: (( label==["shape 3 points"]) | (attr["type"]=="shape" & width > 50)) & (height > 50 & (clientID == serverID))). All objects not exist.', () => {
|
||||
cy.writeFilterValue(
|
||||
true,
|
||||
'(( label==["points shape"]) | (attr["type"]=="shape" & width > 50)) & (height > 50 & (clientID == serverID)))',
|
||||
);
|
||||
checkingFilterApplication([]);
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,77 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { taskName, labelName, attrName } from '../../support/const';
|
||||
|
||||
context('Objects ordering feature', () => {
|
||||
const caseId = '20';
|
||||
|
||||
const createRectangleShape2Points = {
|
||||
points: 'By 2 Points',
|
||||
type: 'Shape',
|
||||
labelName: labelName,
|
||||
firstX: 250,
|
||||
firstY: 350,
|
||||
secondX: 350,
|
||||
secondY: 450,
|
||||
};
|
||||
|
||||
const createRectangleShape2PointsSecond = {
|
||||
points: 'By 2 Points',
|
||||
type: 'Shape',
|
||||
labelName: labelName,
|
||||
firstX: createRectangleShape2Points.firstX + 300,
|
||||
firstY: createRectangleShape2Points.firstY,
|
||||
secondX: createRectangleShape2Points.secondX + 300,
|
||||
secondY: createRectangleShape2Points.secondY,
|
||||
};
|
||||
|
||||
function checkSideBarItemOrdering(ordering) {
|
||||
let cvatObjectsSidebarStateItemIdList = [];
|
||||
cy.get('.cvat-objects-sidebar-state-item').then(($cvatObjectsSidebarStateItemId) => {
|
||||
for (let i = 0; i < $cvatObjectsSidebarStateItemId.length; i++) {
|
||||
cvatObjectsSidebarStateItemIdList.push(Number($cvatObjectsSidebarStateItemId[i].id.match(/\d+$/)));
|
||||
}
|
||||
const idAscent = cvatObjectsSidebarStateItemIdList.reduce((previousValue, currentValue) => {
|
||||
return previousValue > currentValue ? false : true;
|
||||
});
|
||||
if (ordering === 'ascent') {
|
||||
expect(idAscent).to.be.true; //expected true to be true (ascent)
|
||||
} else {
|
||||
expect(idAscent).to.be.false; //expected false to be false (descent)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
before(() => {
|
||||
cy.openTaskJob(taskName);
|
||||
});
|
||||
|
||||
describe(`Testing case "${caseId}"`, () => {
|
||||
it('Create a couple of shapes.', () => {
|
||||
cy.createRectangle(createRectangleShape2Points);
|
||||
cy.createRectangle(createRectangleShape2PointsSecond);
|
||||
checkSideBarItemOrdering('ascent');
|
||||
});
|
||||
|
||||
it('Sort object by "ID - descent".', () => {
|
||||
cy.sidebarItemSortBy('ID - descent');
|
||||
checkSideBarItemOrdering('descent');
|
||||
});
|
||||
it('Sort objects by "Updated time". Change something in the first object. This object now in the top', () => {
|
||||
cy.sidebarItemSortBy('Updated time');
|
||||
cy.get('#cvat_canvas_shape_1').trigger('mousemove').rightclick();
|
||||
cy.get('.cvat-canvas-context-menu').within(() => {
|
||||
cy.contains('.cvat-objects-sidebar-state-item-collapse', 'Details').click();
|
||||
cy.contains('.cvat-object-item-attribute-wrapper', attrName).within(() => {
|
||||
cy.get('.cvat-object-item-text-attribute').clear();
|
||||
});
|
||||
});
|
||||
cy.get('.cvat-canvas-container').click(); // Hide context menu
|
||||
checkSideBarItemOrdering('ascent');
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,43 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { taskName } from '../../support/const';
|
||||
|
||||
context('Canvas color feature', () => {
|
||||
const caseId = '21';
|
||||
|
||||
before(() => {
|
||||
cy.openTaskJob(taskName);
|
||||
});
|
||||
|
||||
describe(`Testing case "${caseId}"`, () => {
|
||||
it('Go to settings', () => {
|
||||
cy.openSettings();
|
||||
});
|
||||
it('Change canvas background color. Color has been changed', () => {
|
||||
cy.get('.cvat-player-settings-canvas-background').within(() => {
|
||||
cy.get('button').click();
|
||||
});
|
||||
cy.get('.canvas-background-color-picker-popover')
|
||||
.find('div[title]')
|
||||
.then((colorPicker) => {
|
||||
for (let i = 0; i < colorPicker.length; i++) {
|
||||
cy.get(colorPicker[i])
|
||||
.click()
|
||||
.should('have.css', 'background-color')
|
||||
.then((colorPickerBgValue) => {
|
||||
cy.get('.cvat-canvas-container')
|
||||
.should('have.css', 'background-color')
|
||||
.then((canvasBgColor) => {
|
||||
//For each color change, compare the value with the css value background-color of .cvat-canvas-container
|
||||
expect(colorPickerBgValue).to.be.equal(canvasBgColor);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,93 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { taskName, labelName } from '../../support/const';
|
||||
|
||||
context('Reset zoom in tag annotation', () => {
|
||||
const issueId = '2174';
|
||||
let scaleFirstFrame = 0;
|
||||
let scaleSecondFrame = 0;
|
||||
let scaleDefault = 0;
|
||||
|
||||
function scaleFrame() {
|
||||
cy.get('.cvat-canvas-container').trigger('wheel', { deltaY: 5 });
|
||||
}
|
||||
|
||||
function changeCheckboxResetZoom(value) {
|
||||
cy.openSettings();
|
||||
cy.get('.ant-modal-content').within(() => {
|
||||
cy.contains('Player').click();
|
||||
cy.get('.cvat-player-settings-reset-zoom-checkbox').within(() => {
|
||||
if (value == 'check') {
|
||||
cy.get('[type="checkbox"]').check();
|
||||
} else if (value == 'uncheck') {
|
||||
cy.get('[type="checkbox"]').uncheck();
|
||||
}
|
||||
});
|
||||
});
|
||||
cy.closeSettings();
|
||||
}
|
||||
|
||||
function checkFrameNum(frameNum) {
|
||||
cy.get('.cvat-player-frame-selector').within(() => {
|
||||
cy.get('input[role="spinbutton"]').should('have.value', frameNum);
|
||||
});
|
||||
}
|
||||
|
||||
before(() => {
|
||||
cy.openTaskJob(taskName);
|
||||
});
|
||||
|
||||
describe(`Testing issue "${issueId}"`, () => {
|
||||
it('Set "reset zoom" to true', () => {
|
||||
changeCheckboxResetZoom('check');
|
||||
});
|
||||
|
||||
it('Go to tag annotation', () => {
|
||||
cy.changeWorkspace('Tag annotation', labelName);
|
||||
});
|
||||
|
||||
it('Scale frame', () => {
|
||||
cy.getScaleValue().then((value) => {
|
||||
scaleDefault = value;
|
||||
});
|
||||
scaleFrame();
|
||||
cy.getScaleValue().then((value) => {
|
||||
scaleFirstFrame = value;
|
||||
});
|
||||
});
|
||||
|
||||
it('Go to next frame and check reset scale on second frame', () => {
|
||||
cy.get('.cvat-player-next-button').click();
|
||||
checkFrameNum(1);
|
||||
cy.getScaleValue().then((value) => {
|
||||
scaleSecondFrame = value;
|
||||
expect(scaleFirstFrame).to.not.equal(scaleSecondFrame);
|
||||
expect(scaleDefault).to.equal(scaleSecondFrame);
|
||||
});
|
||||
});
|
||||
|
||||
it('Set "reset zoom" to false', () => {
|
||||
changeCheckboxResetZoom('uncheck');
|
||||
});
|
||||
|
||||
it('Scale frame', () => {
|
||||
scaleFrame();
|
||||
cy.getScaleValue().then((value) => {
|
||||
scaleSecondFrame = value;
|
||||
});
|
||||
});
|
||||
|
||||
it('Go to previous frame and check save scale on first frame', () => {
|
||||
cy.get('.cvat-player-previous-button').click();
|
||||
checkFrameNum(0);
|
||||
cy.getScaleValue().then((value) => {
|
||||
scaleFirstFrame = value;
|
||||
expect(scaleSecondFrame).to.equal(scaleFirstFrame);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
const randomString = (isPassword) => {
|
||||
let result = '';
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
for (let i = 0; i <= 8; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * characters.length));
|
||||
}
|
||||
return isPassword ? `${result}${Math.floor(Math.random() * 10)}` : result;
|
||||
};
|
||||
|
||||
context('Check email verification system', () => {
|
||||
const caseId = 'Email verification system';
|
||||
const firstName = `${randomString()}`;
|
||||
const lastName = `${randomString()}`;
|
||||
const userName = `${randomString()}`;
|
||||
const emailAddr = `${userName}@local.local`;
|
||||
const password = `${randomString(true)}`;
|
||||
|
||||
before(() => {
|
||||
cy.visit('auth/register');
|
||||
cy.url().should('include', '/auth/register');
|
||||
});
|
||||
|
||||
describe(`Case: "${caseId}"`, () => {
|
||||
it('Register user. Notification exist. The response status is successful.', () => {
|
||||
cy.server().route('POST', '/api/v1/auth/register').as('userRegister');
|
||||
cy.userRegistration(firstName, lastName, userName, emailAddr, password);
|
||||
cy.get('.ant-notification-topRight')
|
||||
.contains(`We have sent an email with a confirmation link to ${emailAddr}.`)
|
||||
.should('exist');
|
||||
cy.wait('@userRegister').its('status').should('eq', 201);
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,19 @@
|
||||
{
|
||||
"video": false,
|
||||
"baseUrl": "http://localhost:8080",
|
||||
"viewportWidth": 1300,
|
||||
"viewportHeight": 960,
|
||||
"defaultCommandTimeout": 25000,
|
||||
"env": {
|
||||
"user": "admin",
|
||||
"email": "admin@localhost.company",
|
||||
"password": "12qwaszx"
|
||||
},
|
||||
"testFiles": [
|
||||
"auth_page.js",
|
||||
"actions_tasks_objects/*",
|
||||
"actions_users/*",
|
||||
"email_system/*",
|
||||
"remove_users_tasks_projects.js"
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
cvat:
|
||||
environment:
|
||||
DJANGO_SETTINGS_MODULE: tests.email_settings
|
||||
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from cvat.settings.production import *
|
||||
|
||||
|
||||
# https://github.com/pennersr/django-allauth
|
||||
ACCOUNT_AUTHENTICATION_METHOD = 'username'
|
||||
ACCOUNT_CONFIRM_EMAIL_ON_GET = True
|
||||
ACCOUNT_EMAIL_REQUIRED = True
|
||||
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
|
||||
|
||||
# Email backend settings for Django
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
Loading…
Reference in New Issue