diff --git a/tests/cypress/integration/actions_users/registration_involved/case_28_review_pipeline_feature.js b/tests/cypress/integration/actions_users/registration_involved/case_28_review_pipeline_feature.js index 1c2242bd..1b2d6d6b 100644 --- a/tests/cypress/integration/actions_users/registration_involved/case_28_review_pipeline_feature.js +++ b/tests/cypress/integration/actions_users/registration_involved/case_28_review_pipeline_feature.js @@ -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.', () => { diff --git a/tests/cypress/support/commands_review_pipeline.js b/tests/cypress/support/commands_review_pipeline.js index 8b1ccbef..18d0ed52 100644 --- a/tests/cypress/support/commands_review_pipeline.js +++ b/tests/cypress/support/commands_review_pipeline.js @@ -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) => {