Cypress test. Adjust, enabling tests for issues 2524 2633. (#4166)

* Update the command

* Rework the test

Co-authored-by: dvkruchinin <dvkruchinin@gmail.com>
main
Dmitry Kruchinin 4 years ago committed by GitHub
parent 57e5e62225
commit fc6525eeb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,4 @@
// Copyright (C) 2020-2021 Intel Corporation
// Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
@ -41,7 +41,6 @@ context('Some parts of the Redux state (issues) is not reset after changing a ta
};
before(() => {
cy.clearLocalStorageSnapshot();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
cy.visit('/');
@ -52,44 +51,19 @@ context('Some parts of the Redux state (issues) is not reset after changing a ta
});
beforeEach(() => {
cy.restoreLocalStorage();
});
afterEach(() => {
cy.saveLocalStorage();
Cypress.Cookies.preserveOnce('sessionid', 'csrftoken');
});
after(() => {
cy.goToTaskList();
cy.deleteTask(taskName.firstTaskName);
cy.reload();
cy.closeModalUnsupportedPlatform();
cy.deleteTask(taskName.secondTaskName);
});
describe(`Testing "${labelName}"`, () => {
// FIXME: review pipeline was redesigned. Need to adjust the test
it.skip('Open first task and request to review.', () => {
cy.openTaskJob(taskName.firstTaskName);
cy.interactMenu('Request a review');
cy.get('.cvat-request-review-dialog')
.should('exist')
.within(() => {
cy.get('.cvat-user-search-field').click();
});
cy.get('.ant-select-dropdown').within(() => {
// eslint-disable-next-line security/detect-non-literal-regexp
cy.contains(new RegExp(`^${Cypress.env('user')}`)).click();
});
cy.contains('.cvat-request-review-dialog', 'Reviewer:').within(() => {
cy.contains('[type="button"]', 'Submit').click();
});
cy.url().should('include', '/tasks');
});
// FIXME: review pipeline was redesigned. Need to adjust the test
it.skip('Open job again and create an issue. Check issue 2633.', () => {
it('Create an issue. Check issue 2633.', () => {
cy.openTaskJob(taskName.firstTaskName);
cy.changeWorkspace('Review');
cy.createIssueFromControlButton(createIssueRectangle);
cy.createIssueFromControlButton(createIssuePoint); // Issue 2633
});
@ -98,6 +72,7 @@ context('Some parts of the Redux state (issues) is not reset after changing a ta
cy.goToTaskList();
cy.openTaskJob(taskName.secondTaskName);
cy.get('.cvat-hidden-issue-label').should('not.exist');
cy.get('.cvat_canvas_issue_region').should('not.exist');
});
});
});

@ -1,4 +1,4 @@
// Copyright (C) 2020-2021 Intel Corporation
// Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
@ -146,10 +146,12 @@ Cypress.Commands.add('createIssueFromControlButton', (createIssueParams) => {
.trigger('mousedown', createIssueParams.firstX, createIssueParams.firstY, { button: 0 })
.trigger('mouseup');
}
cy.intercept('POST', '/api/v1/issues?*').as('issues');
cy.get('.cvat-create-issue-dialog').within(() => {
cy.get('#issue_description').type(createIssueParams.description);
cy.get('[type="submit"]').click();
});
cy.wait('@issues').its('response.statusCode').should('equal', 201);
cy.checkIssueRegion();
});

Loading…
Cancel
Save