You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically. What I am struggling with, seems to be that when a document is loaded like so:
event.respondWith((async()=>{returnnewResponse(`<html><body class="sw-body"><h1>200</h1>${url} found<script>window.onload = function() { let p = document.createElement('p');p.innerHTML = 'this is written with document write on load';document.querySelector('body').append(p) }</script></body></html>`,{status: 200,headers: {"Content-Type": "text/html"},})})(),)
It seems cypress thinks the document is still loading and ends up timing out:
CypressError: Timed out after waiting `10000ms` for your remote page to load.
Your page did not fire its `load` event within `10000ms`.
You can try increasing the `pageLoadTimeout` value in `cypress.config.js` to wait longer.
Browsers will not fire the `load` event until all stylesheets and scripts are done downloading.
When this `load` event occurs, Cypress will continue running commands.
As you can see, I am actually making sure the browser knows the onload event is fired, by writing that in the body when it happens.
Desired behavior
Recognise that the document is loaded, and not trigger the timeout error
describe('Start the site',()=>{it('Starts and works',()=>{consturl='http://localhost:3000'cy.visit(url)cy.get('body.sw-body',{timeout: 10000}).should('exist');})})
Cypress Version
13.15.0
Node version
16.20.0
Operating System
Ubuntu 22.04
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered:
Current behavior
I am trying to test a much more convoluted setup than this, but I boiled it down to a very simple reproducible repo that can be found here:
https://github.com/eiriksm/cy-repro
Basically. What I am struggling with, seems to be that when a document is loaded like so:
It seems cypress thinks the document is still loading and ends up timing out:
As you can see, I am actually making sure the browser knows the onload event is fired, by writing that in the body when it happens.
Desired behavior
Recognise that the document is loaded, and not trigger the timeout error
Test code to reproduce
https://github.com/eiriksm/cy-repro
And basically this is the cypress test:
Cypress Version
13.15.0
Node version
16.20.0
Operating System
Ubuntu 22.04
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: