-
Notifications
You must be signed in to change notification settings - Fork 29
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
fix(cypress): onBeforeLoad being called during login #3480
Conversation
🦋 Changeset detectedLatest commit: d8548e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -125,7 +125,7 @@ function loginByForm(commandOptions: CommandLoginOptions) { | |||
// const mcFrontendHostname = mcUrl.hostname.replace('mc-api', 'mc'); | |||
|
|||
function authCallback() { | |||
cy.visit(url); | |||
cy.visit(url, { onBeforeLoad: commandOptions.onBeforeLoad }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified this locally with a patched package.
* fix(cypress): onBeforeLoad being called during login * Create large-bats-travel.md
Summary
The
onBeforeLoad
never seems to be called which this intends to fix.Description
In the
loginByOidc
we call theonBeforeLoad
like:I noticed that we do not do this when logging in via the form. This causes issues internally when we use the general
loginToMerchantCenter
command which we often pass anonBeforeLoad
to e.g. set local storage values to hide collapse the menu or hide certain models (like for rebranding).We could either invoke the
onBeforeLoad
in theauthCallback
or when navigating to theinitialRoute
. The latter seems unexpected as you then only invoke the callback when another parameter is passed.