Skip to content

Commit

Permalink
fix(e2e): oidc login and registration with upstream parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Benehiko committed Mar 6, 2023
1 parent f5e732e commit aecb88b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ context("Social Sign In Successes", () => {
cy.location("href").should("eq", "https://www.example.org/")
cy.logout()
cy.noSession()
cy.intercept("POST", "**/self-service/login*").as("getHydraLogin")
cy.intercept("GET", "**/oauth2/auth*").as("getHydraLogin")
cy.loginOidc({
app,
url: login + "?return_to=https://www.example.org/",
Expand All @@ -77,9 +77,9 @@ context("Social Sign In Successes", () => {
cy.addInputElement("form", "upstream_parameters.login_hint", email)
},
})
// once a request to get settings responds, 'cy.wait' will resolve
// once a request to getHydraLogin responds, 'cy.wait' will resolve
cy.wait("@getHydraLogin")
.its("response.headers.location")
.its("request.url")
.should("include", "login_hint=" + encodeURIComponent(email))

cy.location("href").should("eq", "https://www.example.org/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,17 @@ context("Social Sign Up Successes", () => {

it("should be able to register with upstream parameters", () => {
const email = gen.email()
cy.intercept("**/self-service/registration*").as("getHydraRegistration")
cy.intercept("GET", "**/oauth2/auth*").as("getHydraRegistration")

cy.visit(registration + "?return_to=https://www.example.org/")

cy.addInputElement("form", "login_hint", email)
cy.addInputElement("form", "upstream_parameters.login_hint", email)

cy.triggerOidc(app)

// once a request to get settings responds, 'cy.wait' will resolve
// once a request to getHydraRegistration responds, 'cy.wait' will resolve
cy.wait("@getHydraRegistration")
.its("response.headers.location")
.its("request.url")
.should("include", "login_hint=" + encodeURIComponent(email))
})
})
Expand Down

0 comments on commit aecb88b

Please sign in to comment.