Merge pull request #2433 from DmitriyOparin/do/cypress_test_pr_2203_error_сannot_read_property_at_saving_job

Cypress test. Error сannot read property at saving job.
main
Boris Sekachev 5 years ago committed by GitHub
commit 191b54fdfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,17 +18,13 @@ context('Dump annotation if cuboid created', () => {
secondY: 450,
};
function save() {
cy.get('button').contains('Save').click({ force: true });
}
before(() => {
cy.openTaskJob(taskName);
});
after('Go to task list', () => {
cy.removeAnnotations();
save();
cy.saveJob();
});
describe(`Testing issue "${issueId}"`, () => {
@ -38,7 +34,7 @@ context('Dump annotation if cuboid created', () => {
});
it('Dump an annotation', () => {
cy.get('.cvat-annotation-header-left-group').within(() => {
save();
cy.saveJob();
cy.get('button').contains('Menu').trigger('mouseover', { force: true });
});
cy.get('.cvat-annotation-menu').within(() => {

@ -0,0 +1,56 @@
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const';
context('Check error сannot read property at saving job', () => {
const prId = '2203';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
labelName: labelName,
firstX: 100,
firstY: 100,
secondX: 300,
secondY: 300,
};
before(() => {
cy.openTaskJob(taskName);
});
after('Remove annotations and save job', () => {
cy.removeAnnotations();
cy.saveJob();
});
describe(`Testing pr "${prId}"`, () => {
it('Create an object in first frame', () => {
cy.createRectangle(createRectangleShape2Points);
});
it('Go to next frame and create an object in second frame', () => {
cy.get('.cvat-player-next-button').click();
cy.createRectangle(createRectangleShape2Points);
});
it('Go to AAM', () => {
cy.changeWorkspace('Attribute annotation', labelName);
});
it('Save job and go to previous frame at saving job', () => {
cy.server().route('PATCH', '/api/v1/jobs/**').as('saveJob');
cy.saveJob();
cy.get('body').type('d');
cy.wait('@saveJob').its('status').should('equal', 200);
});
it('Page with the error is missing', () => {
cy.get('.cvat-global-boundary').should('not.exist');
});
});
});

@ -74,6 +74,12 @@ Cypress.Commands.add('openTask', (taskName) => {
cy.contains('strong', taskName).parents('.cvat-tasks-list-item').contains('a', 'Open').click({ force: true });
});
Cypress.Commands.add('saveJob', () => {
cy.get('button')
.contains('Save')
.click({ force: true });
});
Cypress.Commands.add('openJob', (jobNumber = 0) => {
let tdText = '';
cy.get('.ant-table-tbody')

Loading…
Cancel
Save