warpdesign / cypress-test-redirect-before-onload

Tiny Cypress E2E test case for timeout when redirecting before onload event

Home Page:https://www.cypress.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cypress-test-tiny

Tiny Cypress E2E test case to reproduce redirect error

Description of the issue

It seems that when the page being visited by Cypress attempts to change the location before the load event is triggered, Cypress will then wait forever for the load event, even after the new page has been fully loaded.

Page that's being visited:

<!DOCTYPE html>
<html>
    <script type="text/javascript">
        // uncomment this line to trigger bug:
        window.location.replace('https://warpdesign.fr/tests/another/')
    </script>
    <body>
        Redirect Test
    </body>
</html>

This simple test will trigger a timeout error when visiting the above page:

/// <reference types="cypress" />
describe('page', () => {
  it('triggers a timeout error', () => {
    cy.visit('/index2.html')
  })
})

About

Tiny Cypress E2E test case for timeout when redirecting before onload event

https://www.cypress.io/


Languages

Language:JavaScript 100.0%