I have many pages in my web app where its taking time to load the pages. In the below example, I would like to avoid or reduce the using of cy.wait() as it is not ideal. How can we apply cy.route() in this example, can we create a common function and use that we ever possible ?
note: Dev team are converting some old pages to React and dealing loading issues.
//test.spec.js
cy.wait(5000);
cy.bookspanel.getBookNavigationTab();
//bookhelpfunctions.js
cy.bookspanel = {
getBookNavigationTab: function () {
return cy.get('a > span').contains("Books").click();
}
}
//index.js
import './bookhelpfunctions'
<a class="sc-iybRtq eCauUN" href="/spa/books?candidateStatusId=44501c83-5652-4462-9512-2e482514e28f"><span class="sc-iQtOjA hRzpyH"></span><span class="sc-cEvuZC gFbQRN">Books</span></a>