I'm using Cypress to test my spa. Sometimes the page displays quickly and sometimes it is very slow. I need to be able to check for a button or text that will display once the page is loaded, but do not want to wait for eternity.
I've been using excessively long wait periods but would like the test to run faster.
let targeturl = 'http:\\something.com'
let longwait = 2500
describe('Update Case', () => {
it('Create Case', () => {
cy.visit(targeturl)
cy.wait(longwait)
cy.get('button').contains('Create').click()
I want to be able to set a wait that waits until the button 'Create' is displayed.