Skip to content

Commit

Permalink
funtion
Browse files Browse the repository at this point in the history
  • Loading branch information
MayraMelisa committed Sep 27, 2024
1 parent f330020 commit 90477c5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pages/naturalLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,19 @@ export class NaturalLanguage {
cy.get('textarea[class="m-0 border-0 form-control"]').should('be.visible').type(processName, {delay:50});
cy.get('button[class="px-4 btn btn-primary text-uppercase"]').should('be.visible').click();
}

waitUntilElementIsVisibleIframe(type, selectorXPath, maxAttempts = 15, attempts = 0) {
if (attempts > maxAttempts) {
throw new Error("Timed out waiting for report to be generated");
}
if (type === 'selector') {
cy.wait(4000);
cy.iframe('[id="alternative_a"]')
.then($body => {
if ($body.find(selectorXPath).length <= 0) {
this.waitUntilElementIsVisibleIframe(type, selectorXPath, maxAttempts, attempts + 1);
}
})
}
}
}

0 comments on commit 90477c5

Please sign in to comment.