-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: using email test for consent integration
- Loading branch information
Siddharth
committed
Nov 9, 2023
1 parent
3fb883f
commit 3c2a294
Showing
2 changed files
with
24 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
NEXT_AUTH_SESSION_TOKEN=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..kYHsbR7VC7a9AJWX.x32MS6N-QQw2DGLcjbcf01xkorbK94446KrRluDXI9QLN1dzGLRZcf2Zr60Xi27ZSL2f2lwlR_7BNCy69D_mf9-N2GLRKDI-xLhjwVKmR-1BIqVy_yOlCHMj5U7nAIsDrmhUW4_MQBQEtMmFw0rFtg12DGX9BdPnibau5erwC_sISSZilCqsIzPwibKA4fCNQJzeChpSLKRKuglIxN-DEvO77_ynXeBCV7Ba1BFYWoSSZwy7M8PsA4gmyHDFyN1P4hSA8obE7H4U1iwE1uAKcH04YJTc6fH5a_koFZcr8aUBRSfa_ze92IRQPwaT76-KmVNWr5sNLUpdGnp7tr-IKrCAAWqtawoOiOvJSsBRQrwbUwmQ-XOwvaM5YV9vWjD-W4-7cjAIdnQ_xGzv60BvE8kfKUie6_5J-_0WHSTvBZeK1qL1cfxiqcr5Ftkc5rtb58yLMUYB4YzmdotburUW9mz1esMevKLTPR0VYUOPbeoPXv0.Ju6wTFcMAvSy9pd68uHoxg | ||
NEXT_AUTH_SESSION_TOKEN=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..vmisGHmDOGLXoiQY.GpGQpam4MCUQs1EW6l_8-pu3j3mn4ORmkWwmnJbCfO1ofIA_oPF5ZepoYDhEl1YaQZbexJFM6DFiNBVXHDSDSKocqeNNnOrtk9ggwwJg84zxJsCp9MMuDFfm3CKJS_piDxXWnUu4qgdfgWbqq06mlfnyY2GRSK7_EgAPas1zr858w67x4cxW0KXVO-Ci1QB-Q7T4cT7RQpmMN-KeQbG7K-yEeaLJkz0g46Nl_87V4gUJ01qB6o9b5EWBQ9GHA0KSQmTdbjTr0WbkgSViYBaYgVdLxpkDmI_6H2tCCHA4j6WXZfMutnHvWZ-Nj67N0vMJKrQ3hZE6b5dsE4pkn5el1-4BVw.wjsb9kIIOhOUhz4ym5_Utw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
describe("Consent integration Test", () => { | ||
const signInData = { | ||
PHONE_NUMBER: "+16505554350", | ||
VERIFICATION_CODE: "000000", | ||
EMAIL: "[email protected]", | ||
} | ||
|
||
before(() => { | ||
|
@@ -10,29 +9,31 @@ describe("Consent integration Test", () => { | |
|
||
it("Consent integration", () => { | ||
cy.contains("button", "Sign in with Blink").click() | ||
const email = signInData.EMAIL | ||
cy.wait(2000) | ||
cy.get("[data-testid=sign_in_with_phone_text]").click() | ||
cy.get("[data-testid=phone_number_input]").type(signInData.PHONE_NUMBER) | ||
cy.get("[data-testid=phone_login_next_btn]").click() | ||
cy.wait(2000) | ||
cy.get("[data-testid=verification_code_input]").type(signInData.VERIFICATION_CODE) | ||
cy.wait(2000) | ||
cy.get("[data-testid=email_id_input]").type(email) | ||
cy.get("[data-testid=email_login_next_btn]").click() | ||
cy.getOTP(email).then((otp) => { | ||
const code = otp | ||
cy.wait(2000) | ||
cy.get("[data-testid=verification_code_input]").type(code) | ||
|
||
cy.contains("label", "offline").click() | ||
cy.contains("label", "transactions:read").click() | ||
cy.contains("label", "payments:send").click() | ||
cy.contains("label", "offline").click() | ||
cy.contains("label", "transactions:read").click() | ||
cy.contains("label", "payments:send").click() | ||
|
||
cy.get("[data-testid=submit_consent_btn]").click() | ||
cy.wait(5000) | ||
cy.getCookie("next-auth.session-token").then((cookie) => { | ||
if (cookie && cookie.value) { | ||
cy.writeFile(".env.test", `NEXT_AUTH_SESSION_TOKEN=${cookie.value}\n`, { | ||
flag: "w", | ||
}) | ||
cy.log("Session token saved to .env.test") | ||
} else { | ||
cy.log("Session token not found") | ||
} | ||
cy.get("[data-testid=submit_consent_btn]").click() | ||
cy.wait(5000) | ||
cy.getCookie("next-auth.session-token").then((cookie) => { | ||
if (cookie && cookie.value) { | ||
cy.writeFile(".env.test", `NEXT_AUTH_SESSION_TOKEN=${cookie.value}\n`, { | ||
flag: "w", | ||
}) | ||
cy.log("Session token saved to .env.test") | ||
} else { | ||
cy.log("Session token not found") | ||
} | ||
}) | ||
}) | ||
}) | ||
}) |