Skip to content

Commit

Permalink
chore: use hosted httpbin in e2e tests (#3422)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas authored Aug 9, 2023
1 parent a0f2420 commit 3ddff78
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
12 changes: 9 additions & 3 deletions test/e2e/cypress/helpers/httpbin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ export function checkToken(
check: (token: any) => void,
) {
cy.location("href")
.should("match", new RegExp("https://httpbin.org/anything[?]code=.*"))
.then((body) => {
.should(
"match",
new RegExp(
"https://ory-network-httpbin-ijakee5waq-ez.a.run.app/anything[?]code=.*",
),
)
.then(() => {
cy.get("body")
.invoke("text")
.then((text) => {
const result = JSON.parse(text)
const tokenParams = {
code: result.args.code,
redirect_uri: "https://httpbin.org/anything",
redirect_uri:
"https://ory-network-httpbin-ijakee5waq-ez.a.run.app/anything",
scope: scope.join(" "),
}
oauth2
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/cypress/helpers/oauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function getDefaultAuthorizeURL(client: oAuth2Client) {
client.id,
undefined,
nonce,
"https://httpbin.org/anything",
"https://ory-network-httpbin-ijakee5waq-ez.a.run.app/anything",
"code",
["offline", "openid"],
state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ context("OpenID Provider", () => {
scopes: ["openid", "offline", "email", "website"],
callbacks: [
"http://localhost:5555/callback",
"https://httpbin.org/anything",
"https://ory-network-httpbin-ijakee5waq-ez.a.run.app/anything",
],
}

Expand Down Expand Up @@ -160,7 +160,7 @@ context("OpenID Provider - change between flows", () => {
scopes: ["openid", "offline", "email", "website"],
callbacks: [
"http://localhost:5555/callback",
"https://httpbin.org/anything",
"https://ory-network-httpbin-ijakee5waq-ez.a.run.app/anything",
],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ context("OIDC Provider 2FA", () => {
scopes: ["openid", "offline", "email", "website"],
callbacks: [
"http://localhost:5555/callback",
"https://httpbin.org/anything",
"https://ory-network-httpbin-ijakee5waq-ez.a.run.app/anything",
],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ context("OpenID Provider", () => {
scopes: ["openid", "offline", "email", "website"],
callbacks: [
"http://localhost:5555/callback",
"https://httpbin.org/anything",
"https://ory-network-httpbin-ijakee5waq-ez.a.run.app/anything",
],
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ prepare() {
--response-type code --response-type id_token \
--scope openid --scope offline --scope email --scope website \
--redirect-uri http://localhost:5555/callback \
--redirect-uri https://httpbin.org/anything \
--redirect-uri https://ory-network-httpbin-ijakee5waq-ez.a.run.app/anything \
--format json)
export CYPRESS_OIDC_DUMMY_CLIENT_ID=$(jq -r '.client_id' <<< "$dummy_client" )
export CYPRESS_OIDC_DUMMY_CLIENT_SECRET=$(jq -r '.client_secret' <<< "$dummy_client" )
Expand Down

0 comments on commit 3ddff78

Please sign in to comment.