Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Sep 28, 2020
1 parent 3b8ca5e commit 1dec5b2
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,12 @@ export const selectThresholdRuleType = () => {
cy.get(THRESHOLD_TYPE).click({ force: true });
};

export const waitForTheRuleToBeExecuted = () => {
cy.get(RULE_STATUS)
.invoke('text')
.then((status) => {
if (status !== 'succeeded') {
cy.get(REFRESH_BUTTON).click();
}
});
cy.get(RULE_STATUS).should('have.text', 'succeeded');
export const waitForTheRuleToBeExecuted = async () => {
let status = '';
while (status !== 'succeeded') {
cy.get(REFRESH_BUTTON).click();
status = await cy.get(RULE_STATUS).invoke('text').promisify();
}
};

export const selectEqlRuleType = () => {
Expand Down

0 comments on commit 1dec5b2

Please sign in to comment.