how can i reliably wait for XHR requests after loading a page in a Cypress test? [closed]

You can do something like this:

// Give an alias to request
cy.intercept({
  method: 'GET',
  url: '/odata/locations/**',
}).as('dataGetFirst');

// Visit site
cy.visit('admin/locations');

// Wait for response.status to be 200
cy.wait('@dataGetFirst').its('response.statusCode').should('equal', 200)

// Continue

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)