diff --git a/apps/consent/cypress/e2e/email-sign-in/login-email.cy.ts b/apps/consent/cypress/e2e/email-sign-in/login-email.cy.ts index 780c07ba39..3ea4ec250f 100644 --- a/apps/consent/cypress/e2e/email-sign-in/login-email.cy.ts +++ b/apps/consent/cypress/e2e/email-sign-in/login-email.cy.ts @@ -17,20 +17,28 @@ describe("Account ID Test", () => { it("Login email Test", () => { cy.log("login challenge : ", login_challenge) const email = testData.EMAIL - cy.get("[data-testid=email_id_input]") - .should("exist") - .and("be.visible") - .and("not.be.disabled") - .type(email) - cy.get("[data-testid=email_login_next_btn]").should("exist").and("be.visible").click() + + cy.get("[data-testid=email_id_input]").should("exist") + cy.get("[data-testid=email_id_input]").should("be.visible") + cy.get("[data-testid=email_id_input]").should("not.be.disabled") + cy.get("[data-testid=email_id_input]").type(email) + + cy.get("[data-testid=email_login_next_btn]").should("exist") + cy.get("[data-testid=email_login_next_btn]").should("be.visible") + cy.get("[data-testid=email_login_next_btn]").click() + cy.getOTP(email).then((otp) => { const code = otp - cy.get("[data-testid=verification_code_input]") - .should("exist") - .and("be.visible") - .and("not.be.disabled") - .type(code) - cy.get("[data-testid=submit_consent_btn]").should("exist").and("be.visible").click() + + cy.get("[data-testid=verification_code_input]").should("exist") + cy.get("[data-testid=verification_code_input]").should("be.visible") + cy.get("[data-testid=verification_code_input]").should("not.be.disabled") + cy.get("[data-testid=verification_code_input]").type(code) + + cy.get("[data-testid=submit_consent_btn]").should("exist") + cy.get("[data-testid=submit_consent_btn]").should("be.visible") + cy.get("[data-testid=submit_consent_btn]").should("not.be.disabled") + cy.get("[data-testid=submit_consent_btn]").click() }) }) }) diff --git a/apps/consent/cypress/e2e/phone-sign-in/login-phone.cy.ts b/apps/consent/cypress/e2e/phone-sign-in/login-phone.cy.ts index 00e25f0127..17d9136f2d 100644 --- a/apps/consent/cypress/e2e/phone-sign-in/login-phone.cy.ts +++ b/apps/consent/cypress/e2e/phone-sign-in/login-phone.cy.ts @@ -16,15 +16,20 @@ describe("Account ID Test", () => { it("Verification Test", () => { cy.log("login challenge : ", login_challenge) - cy.get("[data-testid=sign_in_with_phone_text]") - .should("exist") - .and("be.visible") - .click() - cy.get("[data-testid=phone_number_input]") - .should("exist") - .and("be.visible") - .type(testData.PHONE_NUMBER) - cy.get("[data-testid=phone_login_next_btn]").should("exist").and("be.visible").click() + + cy.get("[data-testid=sign_in_with_phone_text]").should("exist") + cy.get("[data-testid=sign_in_with_phone_text]").should("be.visible") + cy.get("[data-testid=sign_in_with_phone_text]").click() + + cy.get("[data-testid=phone_number_input]").should("exist") + cy.get("[data-testid=phone_number_input]").should("be.visible") + cy.get("[data-testid=phone_number_input]").should("not.be.disabled") + cy.get("[data-testid=phone_number_input]").type(testData.PHONE_NUMBER) + + cy.get("[data-testid=phone_login_next_btn]").should("exist") + cy.get("[data-testid=phone_login_next_btn]").should("be.visible") + cy.get("[data-testid=phone_login_next_btn]").should("not.be.disabled") + cy.get("[data-testid=phone_login_next_btn]").click() if (!login_challenge) { throw new Error("login_challenge does not found") @@ -37,10 +42,15 @@ describe("Account ID Test", () => { }) cy.setCookie(login_challenge, cookieValue, { secure: true }) cy.visit(`/login/verification?login_challenge=${login_challenge}`) - cy.get("[data-testid=verification_code_input]") - .should("exist") - .and("be.visible") - .type(testData.VERIFICATION_CODE) - cy.get("[data-testid=submit_consent_btn]").should("exist").and("be.visible").click() + + cy.get("[data-testid=verification_code_input]").should("exist") + cy.get("[data-testid=verification_code_input]").should("be.visible") + cy.get("[data-testid=verification_code_input]").should("not.be.disabled") + cy.get("[data-testid=verification_code_input]").type(testData.VERIFICATION_CODE) + + cy.get("[data-testid=submit_consent_btn]").should("exist") + cy.get("[data-testid=submit_consent_btn]").should("be.visible") + cy.get("[data-testid=submit_consent_btn]").should("not.be.disabled") + cy.get("[data-testid=submit_consent_btn]").click() }) })