Skip to content

Commit

Permalink
test: split commands in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddharth committed Nov 20, 2023
1 parent 932f725 commit f7bee39
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
25 changes: 14 additions & 11 deletions apps/dashboard/cypress/e2e/api-keys/api-keys.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,39 @@ describe("Callback Test", () => {
cy.visit("/")
cy.get("[data-testid=sidebar-api-keys-link]").should("exist")
cy.get("[data-testid=sidebar-api-keys-link]").should("be.visible")
cy.get("[data-testid=sidebar-api-keys-link]").should("not.be.disabled").click()
cy.get("[data-testid=sidebar-api-keys-link]").should("not.be.disabled")
cy.get("[data-testid=sidebar-api-keys-link]").click()
})

it("Api Key creation Test", () => {
cy.get('[data-testid="create-api-add-btn"]').should("exist")
cy.get('[data-testid="create-api-add-btn"]').should("be.visible")
cy.get('[data-testid="create-api-add-btn"]').should("not.be.disabled").click()
cy.get('[data-testid="create-api-add-btn"]').should("not.be.disabled")
cy.get('[data-testid="create-api-add-btn"]').click()

cy.get('[data-testid="create-api-name-input"]').should("exist")
cy.get('[data-testid="create-api-name-input"]').should("be.visible")
cy.get('[data-testid="create-api-name-input"]')
.should("not.be.disabled")
.type("New API Key")
cy.get('[data-testid="create-api-name-input"]').should("not.be.disabled")
cy.get('[data-testid="create-api-name-input"]').type("New API Key")

cy.get('[data-testid="create-api-expire-select"]').should("exist")
cy.get('[data-testid="create-api-expire-select"]').should("be.visible")
cy.get('[data-testid="create-api-expire-select"]').should("not.be.disabled").click()
cy.get('[data-testid="create-api-expire-select"]').should("not.be.disabled")
cy.get('[data-testid="create-api-expire-select"]').click()

cy.get('[data-testid="create-api-expire-30-days-select"]').should("exist")
cy.get('[data-testid="create-api-expire-30-days-select"]').should("be.visible")
cy.get('[data-testid="create-api-expire-30-days-select"]')
.should("not.be.disabled")
.click()
cy.get('[data-testid="create-api-expire-30-days-select"]').should("not.be.disabled")
cy.get('[data-testid="create-api-expire-30-days-select"]').click()

cy.get('[data-testid="create-api-create-btn"]').should("exist")
cy.get('[data-testid="create-api-create-btn"]').should("be.visible")
cy.get('[data-testid="create-api-create-btn"]').should("not.be.disabled").click()
cy.get('[data-testid="create-api-create-btn"]').should("not.be.disabled")
cy.get('[data-testid="create-api-create-btn"]').click()

cy.get('[data-testid="create-api-close-btn"]').should("exist")
cy.get('[data-testid="create-api-close-btn"]').should("be.visible")
cy.get('[data-testid="create-api-close-btn"]').should("not.be.disabled").click()
cy.get('[data-testid="create-api-close-btn"]').should("not.be.disabled")
cy.get('[data-testid="create-api-close-btn"]').click()
})
})
19 changes: 13 additions & 6 deletions apps/dashboard/cypress/e2e/consent-integration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,37 @@ describe("Consent integration Test", () => {
it("Consent integration", () => {
cy.contains("button", "Sign in with Blink").should("exist")
cy.contains("button", "Sign in with Blink").should("be.visible")
cy.contains("button", "Sign in with Blink").should("not.be.disabled").click()
cy.contains("button", "Sign in with Blink").should("not.be.disabled")
cy.contains("button", "Sign in with Blink").click()

const email = signInData.EMAIL
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").type(email)
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]").should("not.be.disabled").click()
cy.get("[data-testid=email_login_next_btn]").should("not.be.disabled")
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")
cy.get("[data-testid=verification_code_input]").should("be.visible")
cy.get("[data-testid=verification_code_input]").should("not.be.disabled").type(code)
cy.get("[data-testid=verification_code_input]").should("not.be.disabled")
cy.get("[data-testid=verification_code_input]").type(code)

cy.contains("label", "read").should("exist")
cy.contains("label", "read").should("be.visible")
cy.contains("label", "read").should("not.be.disabled").click()
cy.contains("label", "read").should("not.be.disabled")
cy.contains("label", "read").should("not.be.disabled")
cy.contains("label", "read").click()

cy.contains("label", "write").should("exist")
cy.contains("label", "write").should("be.visible")
cy.contains("label", "write").should("not.be.disabled").click()
cy.contains("label", "write").should("not.be.disabled")
cy.contains("label", "write").click()

cy.get("[data-testid=submit_consent_btn]").should("exist")
cy.get("[data-testid=submit_consent_btn]").should("be.visible")
Expand Down

0 comments on commit f7bee39

Please sign in to comment.