Update cypress test. Review pipeline feature. (#3118)

* Upate cypress command.

Added the ability to re-open the issue.

* Update cypress test. Added re-open an issue.

* Apply comments

Co-authored-by: Dmitry Kalinin <dmitry.kalinin@intel.com>

Co-authored-by: Dmitry Kalinin <dmitry.kalinin@intel.com>
main
Dmitry Kruchinin 5 years ago committed by GitHub
parent 2a9a1e93db
commit 17908003df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -381,10 +381,12 @@ context('Review pipeline feature', () => {
});
it('Display all the issues again. Comment a couple of issues and resolve all them.', () => {
function resolveIssue() {
function resolveReopenIssue(reopen) {
cy.collectIssueLabel().then((issueLabelList) => {
for (let label = 0; label < issueLabelList.length; label++) {
cy.resolveIssue(issueLabelList[label], 'Done');
reopen
? cy.resolveReopenIssue(issueLabelList[label], 'Please fix', true)
: cy.resolveReopenIssue(issueLabelList[label], 'Done');
}
});
}
@ -395,12 +397,17 @@ context('Review pipeline feature', () => {
cy.get('.cvat-hidden-issue-label').should('exist').and('have.length', 1);
cy.get('.cvat-issues-sidebar-previous-frame').click();
resolveIssue();
resolveReopenIssue();
cy.checkIssueLabel('Done', 'resolved');
cy.goCheckFrameNumber(2);
resolveIssue();
resolveReopenIssue();
cy.checkIssueLabel('Done', 'resolved');
cy.goCheckFrameNumber(0);
// Reopen issues
resolveReopenIssue(true);
// Resolve again
resolveReopenIssue();
});
it('Request a review again. Assign the third user again. The second user logout.', () => {

@ -137,13 +137,20 @@ Cypress.Commands.add('createIssueFromControlButton', (createIssueParams) => {
cy.checkIssueRegion();
});
Cypress.Commands.add('resolveIssue', (issueLabel, resolveText) => {
Cypress.Commands.add('resolveReopenIssue', (issueLabel, resolveText, reopen) => {
cy.get(issueLabel).click();
cy.intercept('POST', '/api/v1/comments').as('postComment');
cy.intercept('PATCH', '/api/v1/issues/**').as('resolveReopenIssue');
cy.get('.cvat-issue-dialog-input').type(resolveText);
cy.get('.cvat-issue-dialog-footer').within(() => {
cy.contains('button', 'Comment').click();
cy.contains('button', 'Resolve').click();
reopen
? cy.contains('button', 'Reopen').click()
: cy.contains('button', 'Resolve').click();
});
if (reopen) cy.get('.cvat-issue-dialog-header').find('[aria-label="close"]').click();
cy.wait('@postComment').its('response.statusCode').should('equal', 201);
cy.wait('@resolveReopenIssue').its('response.statusCode').should('equal', 200);
});
Cypress.Commands.add('submitReview', (decision, user) => {

Loading…
Cancel
Save