Skip to content

Commit f8b221b

Browse files
committed
pkp#10993 Reviewer Suggestion E2E test
1 parent bed5f4e commit f8b221b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* @file cypress/support/command_reviewer_suggestion.js
3+
*
4+
* Copyright (c) 2025 Simon Fraser University
5+
* Copyright (c) 2025 John Willinsky
6+
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
7+
*
8+
*/
9+
10+
Cypress.Commands.add('enableReviewerSuggestion', () => {
11+
cy.login('admin', 'admin');
12+
13+
cy.visit('index.php/publicknowledge/management/settings/workflow');
14+
cy.get('button#review-button').should('exist').click();
15+
16+
// Check that the checkbox to enable Reviewer Suggestion is visible, unchecked, and select it
17+
cy.get('input[name="reviewerSuggestionEnabled"]').should('be.visible').should('not.be.checked').check();
18+
19+
cy.get('button:contains("Save")').eq(3).should('be.visible').click();
20+
cy.wait(2000);
21+
cy.reload();
22+
23+
cy.get('input[name="reviewerSuggestionEnabled"]').should('be.visible').should('be.checked');
24+
});
25+
26+
Cypress.Commands.add('disbaleReviewerSuggestion', () => {
27+
cy.login('admin', 'admin');
28+
29+
cy.visit('index.php/publicknowledge/management/settings/workflow');
30+
cy.get('button#review-button').should('exist').click();
31+
32+
// Check that the checkbox to enable Reviewer Suggestion is visible, checked, and unselect it
33+
cy.get('input[name="reviewerSuggestionEnabled"]').should('be.visible').should('be.checked').uncheck();
34+
35+
cy.get('button:contains("Save")').eq(3).should('be.visible').click();
36+
cy.wait(2000);
37+
cy.reload();
38+
39+
cy.get('input[name="reviewerSuggestionEnabled"]').should('be.visible').should('not.be.checked');
40+
});

0 commit comments

Comments
 (0)