Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session not carried from cypress tab to new lighthouse tab #67

Closed
Gimlehr opened this issue Feb 24, 2021 · 4 comments
Closed

Session not carried from cypress tab to new lighthouse tab #67

Gimlehr opened this issue Feb 24, 2021 · 4 comments

Comments

@Gimlehr
Copy link

Gimlehr commented Feb 24, 2021

Using cypress to navigate though an app logging in or completing a form when a test hits cy.lighthouse a new tab is opened with a new session which causes the app to navigate back to the start page (due to security restrictions/anti forgery if a customer hits a page in the journey without a valid session they get sent to the "home page"), light house then runs against the home page rather than the required page, is there a way to run the audit against the page that cypress already has open?

Is the intended behaviour to open a new tab, if so what is the best way to handle session storage not being carried across to the new tab?

@mfrachet
Copy link
Owner

Hello and thanks for reporting. However, I would have appreciated you take the time to fill the issue template so that I can give you a proper answer 😊 .

Would you mind providing a repro so that I can try things out?

@Gimlehr
Copy link
Author

Gimlehr commented Feb 26, 2021

My apologies I missed the template option some more info below

What does not work?
Application using identity server authentication and anti forgery session, when lighthouse opens a new tab the application directs to the landing/home page as it is unable to find a valid session

How to reproduce?
Internal code so unable to share repo and valid data required to use public site which is not shareable

Expected behavior
Lighthouse should run on the current page which has been navigated to using cypress

Screenshots / Animated Gifs
https://user-images.githubusercontent.com/26442808/109283464-bb2f8780-7816-11eb-8491-cd91a2320705.mp4

Environment (please complete the following information):

  • OS: Windows 10
  • Chrome version: 88
  • Cypress version: 6.5.0

@mfrachet
Copy link
Owner

Without a proper project I can play with, I can't do anything to investigate since I have no clue about your setup, how you do the things on the backend/frontend.

It's not possible for me to give you a proper answer without something I can play with.

Closing for now but feel free to reopen with a repro of the problem if you can at some points 🙏🏻

Thanks for your help on the project 😊

@MuckT
Copy link
Contributor

MuckT commented Aug 19, 2021

@Gimlehr can you try the workaround in #65.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants