question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CI flake] cy.origin window test flake

See original GitHub issue

Current behavior

Six tests timed out in the cy.origin window tests

CypressError: Timed out after waiting `60000ms` for your remote page to load on origin(s):

- `http://foobar.com:3500`

A cross-origin request for `http://www.foobar.com:3500/fixtures/dom.html` was detected.

A command that triggers cross-origin navigation must be immediately followed by a `cy.origin()` command:

`cy.origin('http://foobar.com:3500', () => {`
`  <commands targeting http://www.foobar.com:3500 go here>`
`})`

If the cross-origin request was an intermediary state, you can try increasing the `pageLoadTimeout` value in `cypress.json` 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.
    at timedOutWaitingForPageLoad (cypress:///../driver/src/cy/commands/navigation.ts:84:72)
    at eval (cypress:///../driver/src/cy/commands/navigation.ts:493:16)
    at tryCatcher (cypress:////root/cypress/node_modules/bluebird/js/release/util.js:16:23)
    at eval (cypress:////root/cypress/node_modules/bluebird/js/release/catch_filter.js:17:41)
    at tryCatcher (cypress:////root/cypress/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (cypress:////root/cypress/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (cypress:////root/cypress/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (cypress:////root/cypress/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (cypress:////root/cypress/node_modules/bluebird/js/release/promise.js:690:18)
    at _drainQueueStep (cypress:////root/cypress/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (cypress:////root/cypress/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (cypress:////root/cypress/node_modules/bluebird/js/release/async.js:147:5)
    at Async.drainQueues (cypress:////root/cypress/node_modules/bluebird/js/release/async.js:17:14)
From Your Spec Code:
    at Context.eval (http://localhost:3500/__cypress/tests?p=cypress/integration/e2e/multi-domain/commands/multi_domain_window.spec.ts:107:8)

The tests that flaked were:

  • cy.origin window .window()
  • cy.origin window .document()
  • cy.origin window .title()
  • cy.origin window #consoleProps .window()
  • cy.origin window #consoleProps .document()
  • cy.origin window #consoleProps .title()

Desired behavior

Tests run reliably.

Test code to reproduce

See: https://app.circleci.com/pipelines/github/cypress-io/cypress/36903/workflows/c8342f8f-3389-4af5-8a2a-0e09f5ff37ba/jobs/1481372

Cypress Version

9.6.0

Other

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mrkjdycommented, Sep 14, 2022

@idanElitzur I opened a different issue #22459

0reactions
mjhenkescommented, Sep 15, 2022

These appear to have been fixed by #23297. At a minimum they cannot manifest in the same way anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flaky Test Management - Cypress Documentation
What is a flaky test? A test is considered to be flaky when it can pass and fail across multiple retry attempts without...
Read more >
How to Fix Flaky Tests - Semaphore CI
Randomly failing tests are the hardest to debug. Here's a framework you can use to fix them and keep your test suite healthy....
Read more >
Cypress e2e testing - How to get around Cross Origin Errors?
Use the GMail UI in your test in an effort to avoid test flake (all UI testing has flakiness), and potential UI changes...
Read more >
rouch/Cypress: Fast, easy and reliable testing for ... - NotABug
.npmrc · ec25c7dff8 chore(windows): make install portable to windows (#4779), 3 years ago ;.percy.yml · c40a120aa7 chore: skip or fix flaky tests (#23167),...
Read more >
How To Perform Cypress Accessibility Testing | LambdaTest
Test websites against criteria; many modern testing tools help companies like ours. For example, you can use a keyboard or screen reader that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found