Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Added sum input to cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philiphand committed May 25, 2021
1 parent dd3948b commit c2e542c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cypress/integration/bank.recurring.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ context("Window", () => {
});

it("End-2-End recurring bank donation", () => {
const randomSum = Math.floor(Math.random() * 1000) + 100;
cy.pickMethod("bank");
cy.pickAnonymous();

Expand All @@ -20,6 +21,10 @@ context("Window", () => {
cy.get("button").click();
cy.wait(500);

cy.react("TextInput", { props: { name: "sum" } }).type(
randomSum.toString()
);

cy.get("button").click();
cy.wait("@registerDonation")
.its("response.statusCode")
Expand Down
5 changes: 5 additions & 0 deletions cypress/integration/bank.single.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ context("Window", () => {
});

it("End-2-End single bank donation", () => {
const randomSum = Math.floor(Math.random() * 1000) + 100;
cy.pickRecurring(false);
cy.pickMethod("bank");
cy.pickAnonymous();
Expand All @@ -21,6 +22,10 @@ context("Window", () => {
cy.get("button").click();
cy.wait(500);

cy.react("TextInput", { props: { name: "sum" } }).type(
randomSum.toString()
);

cy.get("button").click();
cy.wait("@registerDonation")
.its("response.statusCode")
Expand Down
5 changes: 5 additions & 0 deletions cypress/integration/shares.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ context("Window", () => {
});

it("End-2-End shared donation", () => {
const randomSum = Math.floor(Math.random() * 1000) + 100;
cy.intercept("POST", `${API_URL}/donations/register`).as(
"registerDonation"
);
Expand All @@ -28,6 +29,10 @@ context("Window", () => {
cy.get("button").click();
cy.wait(500);

cy.react("TextInput", { props: { name: "sum" } }).type(
randomSum.toString()
);

// DonationPane
cy.react("RichSelectOption", {
props: { value: ShareType.CUSTOM },
Expand Down

0 comments on commit c2e542c

Please sign in to comment.