Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,19 @@ export const reloadDeletedRules = () => {
cy.get(RELOAD_PREBUILT_RULES_BTN).click({ force: true });
};

/**
* Selects the number of rules. Since there can be missing click handlers
* when the page loads at first, we use a pipe and a trigger of click
* on it and then check to ensure that it is checked before continuing
* with the tests.
* @param numberOfRules The number of rules to click/check
*/
export const selectNumberOfRules = (numberOfRules: number) => {
for (let i = 0; i < numberOfRules; i++) {
cy.get(RULE_CHECKBOX).eq(i).click({ force: true });
cy.get(RULE_CHECKBOX)
.eq(i)
.pipe(($el) => $el.trigger('click'))
.should('be.checked');
}
};

Expand Down