Skip to content

Commit

Permalink
fix: e2e consent test
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi committed Oct 21, 2024
1 parent 38062ba commit 9673ad6
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 112 deletions.
45 changes: 0 additions & 45 deletions apps/consent/cypress/e2e/email-sign-in/login-email.cy.ts

This file was deleted.

50 changes: 50 additions & 0 deletions apps/consent/cypress/e2e/login-email.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { testData } from "../support/test-config"

describe("Account ID Test", () => {
before(() => {
cy.flushRedis()
cy.visit(testData.AUTHORIZATION_URL)
cy.location("search").should((search) => {
const params = new URLSearchParams(search)
expect(params.has("login_challenge")).to.be.true
})
})

it("Login email Test", () => {
const email = testData.EMAIL

cy.get("[data-testid=sign_in_with_phone_btn]")
.should("exist")
.should("be.visible")
.click()

cy.get("[data-testid=sign_in_with_email_btn]")
.should("exist")
.should("be.visible")
.click()

cy.get("[data-testid=email_id_input]")
.should("exist")
.should("be.visible")
.should("not.be.disabled")
.type(email)

cy.get("[data-testid=email_login_next_btn]")
.should("exist")
.should("be.visible")
.click()

cy.getOTP(email).then((code) => {
cy.get("[data-testid=verification_code_input]")
.should("exist")
.should("be.visible")
.should("not.be.disabled")
.type(code)

cy.get("[data-testid=submit_consent_btn]")
.should("exist")
.should("be.visible")
.should("not.be.disabled")
})
})
})
47 changes: 47 additions & 0 deletions apps/consent/cypress/e2e/login-phone.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { testData } from "../support/test-config"

describe("Account ID Test", () => {
before(() => {
cy.flushRedis()
cy.visit(testData.AUTHORIZATION_URL)
cy.location("search").should((search) => {
const params = new URLSearchParams(search)
expect(params.has("login_challenge")).to.be.true
})
})

it("Login Phone Test", () => {
cy.get("[data-testid=sign_in_with_email_btn]")
.should("exist")
.should("be.visible")
.click()

cy.get("[data-testid=sign_in_with_phone_btn]")
.should("exist")
.should("be.visible")
.click()

cy.get("[data-testid=phone_number_input]")
.should("exist")
.should("be.visible")
.should("not.be.disabled")
.type(testData.PHONE_NUMBER)

cy.get("[data-testid=phone_login_next_btn]")
.should("exist")
.should("be.visible")
.should("not.be.disabled")
.click()

cy.get("[data-testid=verification_code_input]")
.should("exist")
.should("be.visible")
.should("not.be.disabled")
.type(testData.VERIFICATION_CODE)

cy.get("[data-testid=submit_consent_btn]")
.should("exist")
.should("be.visible")
.should("not.be.disabled")
})
})
67 changes: 0 additions & 67 deletions apps/consent/cypress/e2e/phone-sign-in/login-phone.cy.ts

This file was deleted.

Empty file.

0 comments on commit 9673ad6

Please sign in to comment.