Added functionality for build CVAT with wmail support

main
Kruchinin 5 years ago
parent 953a9aa80e
commit aa70541774

@ -0,0 +1,3 @@
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

@ -6,6 +6,7 @@
"defaultCommandTimeout": 25000,
"env": {
"user": "admin",
"email": "admin@localhost.company",
"password": "12qwaszx"
},
"testFiles": ["auth_page.js", "actions_tasks_objects/*", "actions_users/*", "remove_users_tasks.js"]

@ -13,7 +13,7 @@ const randomString = (isPassword) => {
return isPassword ? `${result}${Math.floor(Math.random() * 10)}` : result;
};
context('Register user, change password, login with new password', () => {
context('Register user, change password, login with new password', { browser: 'chrome' }, () => {
const caseId = '2';
const firstName = `${randomString()}`;
const lastName = `${randomString()}`;

@ -4,7 +4,7 @@
/// <reference types="cypress" />
context('Multiple users. Assign task, job.', () => {
context('Multiple users. Assign task, job.', { browser: 'chrome' }, () => {
const caseId = '4';
const labelName = `Case ${caseId}`;
const taskName = `New annotation task for ${labelName}`;

@ -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', { browser: 'firefox' }, () => {
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', () => {
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);
});
});
});

@ -4,7 +4,14 @@
/// <reference types="cypress" />
context('Issue 1599 (Chinese alphabet).', () => {
context('Issue 1599 (Chinese alphabet).', { browser: 'chrome' }, () => {
const firstName = '测试者'
const lastName = '测试'
const userName = 'Testuser_ch'
const email = 'Testuser_ch@local.local'
const password = 'Qwerty123!'
before(() => {
cy.visit('auth/register');
cy.url().should('include', '/auth/register');
@ -12,33 +19,32 @@ context('Issue 1599 (Chinese alphabet).', () => {
describe('User registration using the Chinese alphabet.', () => {
it('Filling in the placeholder "First name"', () => {
cy.get('[placeholder="First name"]').type('测试者').should('not.have.class', 'has-error');
cy.get('[placeholder="First name"]').type(firstName).should('not.have.class', 'has-error');
});
it('Filling in the placeholder "Last name"', () => {
cy.get('[placeholder="Last name"]').type('测试').should('not.have.class', 'has-error');
cy.get('[placeholder="Last name"]').type(lastName).should('not.have.class', 'has-error');
});
it('Filling in the placeholder "Username"', () => {
cy.get('[placeholder="Username"]').type('Testuser_ch');
cy.get('[placeholder="Username"]').type(userName);
});
it('Filling in the placeholder "Email address"', () => {
cy.get('[placeholder="Email address"]').type('Testuser_ch@local.local');
cy.get('[placeholder="Email address"]').type(email);
});
it('Filling in the placeholder "Password"', () => {
cy.get('[placeholder="Password"]').type('Qwerty123!');
cy.get('[placeholder="Password"]').type(password);
});
it('Filling in the placeholder "Confirm password"', () => {
cy.get('[placeholder="Confirm password"]').type('Qwerty123!');
cy.get('[placeholder="Confirm password"]').type(password);
});
it('Click to "Submit" button', () => {
cy.get('[type="submit"]').click();
});
it('Successful registration', () => {
cy.url().should('include', '/tasks');
});

@ -4,7 +4,14 @@
/// <reference types="cypress" />
context('Issue 1599 (Polish alphabet).', () => {
context('Issue 1599 (Polish alphabet).', { browser: 'chrome' }, () => {
const firstName = 'Świętobor'
const lastName = 'Сzcić'
const userName = 'Testuser_pl'
const email = 'Testuser_pl@local.local'
const password = 'Qwerty123!'
before(() => {
cy.visit('auth/register');
cy.url().should('include', '/auth/register');
@ -12,27 +19,27 @@ context('Issue 1599 (Polish alphabet).', () => {
describe('User registration using the Polish alphabet.', () => {
it('Filling in the placeholder "First name"', () => {
cy.get('[placeholder="First name"]').type('Świętobor').should('not.have.class', 'has-error');
cy.get('[placeholder="First name"]').type(firstName).should('not.have.class', 'has-error');
});
it('Filling in the placeholder "Last name"', () => {
cy.get('[placeholder="Last name"]').type('Сzcić').should('not.have.class', 'has-error');
cy.get('[placeholder="Last name"]').type(lastName).should('not.have.class', 'has-error');
});
it('Filling in the placeholder "Username"', () => {
cy.get('[placeholder="Username"]').type('Testuser_pl');
cy.get('[placeholder="Username"]').type(userName);
});
it('Filling in the placeholder "Email address"', () => {
cy.get('[placeholder="Email address"]').type('Testuser_pl@local.local');
cy.get('[placeholder="Email address"]').type(email);
});
it('Filling in the placeholder "Password"', () => {
cy.get('[placeholder="Password"]').type('Qwerty123!');
cy.get('[placeholder="Password"]').type(password);
});
it('Filling in the placeholder "Confirm password"', () => {
cy.get('[placeholder="Confirm password"]').type('Qwerty123!');
cy.get('[placeholder="Confirm password"]').type(password);
});
it('Click to "Submit" button', () => {

@ -13,6 +13,7 @@ describe('Delete users and tasks created during the test run.', () => {
url: '/api/v1/auth/login',
body: {
username: Cypress.env('user'),
email: Cypress.env('email'),
password: Cypress.env('password'),
},
}).then(async (responce) => {

@ -2,7 +2,5 @@ version: "3.3"
services:
cvat:
volumes:
- ./email_settings.py:/home/django/email_settings.py:ro
environment:
DJANGO_SETTINGS_MODULE: email_settings
DJANGO_SETTINGS_MODULE: tests.email_settings

Loading…
Cancel
Save