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.

10.9.0 broke cy.origin() requests

See original GitHub issue

Current behavior

After upgrading from 10.8.0 to 10.9.0 my cy.origin() requests no longer complete. They timeout instead.

Desired behavior

cy.origin() requests should work as in 10.8.0

Test code to reproduce

In my app, once you enter a username/password on the sign up page, it redirects to a third-party page where I need to press an “Accept” button. My code is:

cy.visit('/sign-up');

// Fill out the sign up form
cy.get('#signup-email').type(email);
cy.get('#signup-password').type(password);
cy.get('#btn-signup').click();

// At this point, my app redirects to https://some.sub.domain.auth0.com/some_url

// Wait until we're redirected to Auth0, and click "Accept" there
cy.origin('auth0.com', () => {
    cy.get('button').contains('Accept').click();
});

This would work in 10.8.0 but in 10.9.0 is times out with:

Timed out retrying after 40000ms: Expected to find content: 'Accept' within the element: [ <button#btn-login.btn.btn-primary.btn-block>, 5 more... ] but never did.

Rolling back to 10.8.0 makes the problem go away.

Cypress Version

10.9.0

Node version

16.14.1

Operating System

macOS 12.6

Debug Logs

No response

Other

I see that the changelog for 10.9.0 includes a bunch of changes to cy.origin() but after reviewing the changes I don’t see why my simple usage of cy.origin() would break completely.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
EvHauscommented, Oct 21, 2022

That looks great!

1reaction
EvHauscommented, Oct 13, 2022

So interestingly upgrading to 10.10.0 made the problem go away entirely without any code changes. 🤷

Will close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changelog - Cypress Documentation
Testing multiple origins in a single test with the new cy.origin() command. ... Use the cy.intercept() command to stub network responses and requests....
Read more >
cypress-io/cypress - Gitter
it('has the right title', () =>{ cy.server(); cy.route('POST' ... hello all - I'm trying to memoize a cy.request call and getting null on...
Read more >
Fixing Cypress cross-origin errors - Reflect.run
A step-by-step guide for avoiding cross-origin errors in Cypress tests via the cy.origin() and cy.session() commands introduced in Cypress ...
Read more >
Actions · cypress-io/cypress · GitHub
[cy.intercept] `times` not working? ... 10.9.0 broke cy.origin() requests Triage: add issue/PR to project #334: Issue #24073 opened by EvHaus.
Read more >
cy.origin() and multiple origins in the same domain
cy.visit('/mysecuredpage'); // this redirects to http://localhost:9081 cy.origin('http://localhost:9081', () => { cy.contains('Please log ...
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