Description
Current behavior
Context
I am trying to automate a few user actions using Cypress and the work-flow goes like this
- Launch a URL in domain-1. The Sign-In page is displayed.
- Enter the Username and password, and click the Sign-In button. The home-page is displayed.
- Launch another URL in domain-2. (this is a sub-domain of domain-1). A profile picker page is displayed.
- Select a profile. A PIN page is displayed.
- On keying in the PIN (4 digit) the same page displayed instead of navigating to the Dashboard page.
Desired behavior
The Dashboard page should be displayed instead the same PIN page is displayed. This happens every time a PIN is entered.
Test code to reproduce
The sandbox env is behind a VPN and cannot be utilized via internet. The production env is available but requires actual credentials and cannot be shared.
The code is pretty straightforward.
- The config flag of 'experimentalSessionAndOrigin' is set to True. The 'chromeWebSecurity' is set to false.
- The cy.origin command is not used when launching the second URL. The issue is reproducible even by using the origin method.
Code Snippet
cy.visit('URL-1')
<code for logging in i.e entering the username and password, and clicking the sign-in button>
cy.visit('URL-2')
<code to select a profile and enter the PIN>
NOTE
- The issue is not reproducible for versions 10.9.0 and below.
- It is reproducible with versions 10.10.0 and above
Cypress Version
10.10.0
Node version
18.20.4
Operating System
macOS 14.6.1
Debug Logs
No response
Other
- From v10.10.0 onward until v11.2.0 if the 'experimentalSessionAndOrigin' config flag is disabled or set to flag, the issue is not seen.
- From v12, 'experimentalSessionAndOrigin' config flag is by default set to true in Cypress and so the issue is reproducible.
One of these two new features introduced in 10.10.0 is causing this issue.
-
cy.origin()'s URL argument must be an exact origin match to the origin of the AUT. Addresses #23999, #23814, #24085, #22882, and #17166.
-
More accurately send/set cookies in cy.origin() when experimentalSessionAndOrigin is enabled. Addresses #23551, #22670, and #23603.