Allow user to prevent the first cy.visit call from setting top. #22889
Labels
E2E
Issue related to end-to-end testing
topic: cy.origin
Problems or enhancements related to cy.origin command
Triaged
Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.
type: enhancement
Requested enhancement of existing feature
What would you like?
Allow user to prevent the first
cy.visit
call from setting top.Why is this needed?
Given Site A (
www.siteA.com
) that server side redirects (www.idp.com
). The natural way to log in withcy.origin
would look like this. This is expected to be a fairly common use case forcy.origin
, along with clicking a button to log in.However this will not work. The initial visit will set top to
www.idp.com
and any subsequent commands that attempted to run onwww.siteA.com
would fail and need to be place in acy.origin
block.The current pattern to achieve this is non obvious, the
cy.visit
that redirects must be placed inside thecy.origin
block.With #21485 we are enabling
cy.visit
to visit cross origin pages. This will allow client side redirects to use our preferred syntax, however without being able to preventcy.visit
from reseting top the preferred syntax will not be available for server side redirects.Other
This issue has affected several users as can be seen in the
cy.origin
discussion, #21186 (reply in thread), #21186 (comment)We have a couple of options to consider if we want to prioritize this:
baseurl
config per test and prevent all visit commands from reseting top (most definitely non passive)The text was updated successfully, but these errors were encountered: