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

3rd party authentication scenario: lighthouse runs the login page on a separate new tab #236

Open
kmock930 opened this issue Nov 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@kmock930
Copy link

Hi guys,
I tried to look into this guide #65 (and many similar ones on the internet) but still cannot resolve my issue.
Basically, I am writing performance test cases in Cypress for my website.
It launches from a third-party Amazon Cognito sign-in page.
So when I go to my website, at first it will redirect me to the Cognito sign-in page, and then after signing in, I will be redirected back to the home page of my website.
What I want to test is the performance metrics of different actions performed on my website. But no matter what, I have to go through the login process.
Here's the problem that I encounter:

  • If the current browser hasn't yet previously signed in to my site, and so there's no cache (relating to this site) being stored in the browser, when I go to the site, the Cognito page will have a button allowing me to sign-in through my organization's SSO.
  • But if the current browser already has been previously used to sign in to my site, and so there's cache storing the previous sign-in data, when I go to the site again, the Cognito page will look different. It will have a button allowing me to Continue to my site (ie. the button shows something like 'Continue with <my organization>'). After clicking on it, I need not to enter passwords from the SSO again, and I am directly signed in.
  • I understand that lighthouse() command in cypress-audit first performs whatever actions I would like to test against, and then opens a new tab in order to estimate the performance metrics, and finally the new tab closes and resumes the Cypress test. So I encounter the "Continue button" mentioned above in this step, in the new tab (that lighthouse() tries to open).

So my question here is:

  • On the new tab, my testing script could not proceed further, because there isn't any sign-in button appearing on the new tab opened by lighthouse(), but instead, there's a "Continue button".
  • So the lighthouse() command got stuck there, causing the metrics measured to be 0. (Kinda frustrating because it obviously does not pass any threshold.)
  • My workaround: manually click the "Continue button" whenever the test script encounters that page.
  • Is there any way to have lighthouse() command automate this step?

Thanks. Feel free to comment.
PS Since my codes are private, I am unfortunately unable to share in the community, but feel free to arrange meetings with me to review and solve it together.
Look forward to any solutions! 💯

@kmock930 kmock930 added the bug Something isn't working label Nov 26, 2023
@kmock930 kmock930 changed the title 3rd party authentication scenario: lighthouse runs for the landing/login page and not the app itself 3rd party authentication scenario: lighthouse runs the login page on a separate new tab Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant