On web application, particular element is visible only after page reload and that is also available after some time, so currently I have implemented it as below:
it('element-check', () => {
cy.visit('url')
// performing certain actions
cy.wait(150000)
cy.reload()
cy.contains('text').click()
})
instead of fixed wait cy.wait(150000), I need to use the polling mechanism in such a way that after every 30 seconds the page is getting reloaded and check for the required element until the element is visible.