diff --git a/cypress/e2e/claim-portal-failure.cy.ts b/cypress/e2e/claim-portal-failure.cy.ts index 96ab8dd4..d20cd09e 100644 --- a/cypress/e2e/claim-portal-failure.cy.ts +++ b/cypress/e2e/claim-portal-failure.cy.ts @@ -18,12 +18,12 @@ describe("Claims Portal Failures", () => { }); it("should handle no connected signer", () => { - cy.get("#additionalDetails", { timeout: 15000 }).should("be.visible").invoke("click"); + cy.get(".additional-details", { timeout: 15000 }).first().should("be.visible").invoke("click"); - cy.get("button[id='make-claim']").should("be.visible").click(); - cy.get("#invalidator").should("not.be.visible"); - cy.get("#claim-loader").should("not.be.visible"); - cy.get("#view-claim").should("not.be.visible").and("include.text", "View Claim"); + cy.get("button.make-claim").first().should("be.visible").click(); + cy.get(".invalidator").should("not.be.visible"); + cy.get(".claim-loader").should("not.be.visible"); + cy.get(".view-claim").should("not.be.visible").and("include.text", "View Claim"); cy.get("body").should("contain.text", "Please connect your wallet to claim this reward."); }); @@ -46,11 +46,11 @@ describe("Claims Portal Failures", () => { }); it("should handle feedback for a failed wallet provider transaction", () => { - cy.get("#additionalDetails", { timeout: 15000 }).should("be.visible").invoke("click"); + cy.get(".additional-details", { timeout: 15000 }).first().should("be.visible").invoke("click"); - cy.get("button[id='make-claim']").should("be.visible").click(); - cy.get("#claim-loader").should("be.visible"); - cy.get("#invalidator").should("not.be.visible"); + cy.get("button.make-claim").first().should("be.visible").click(); + cy.get(".claim-loader").first().should("be.visible"); + cy.get(".invalidator").first().should("not.be.visible"); // cy.get("#claim-loader").should("not.be.visible"); // gets stuck here }); }); diff --git a/cypress/e2e/claim-portal-non-web3.cy.ts b/cypress/e2e/claim-portal-non-web3.cy.ts index c1a51c50..e5cd9bf0 100644 --- a/cypress/e2e/claim-portal-non-web3.cy.ts +++ b/cypress/e2e/claim-portal-non-web3.cy.ts @@ -14,9 +14,9 @@ describe("Claims Portal Non-Web3", () => { cy.visit(`/${claimUrl}`); cy.wait(2000); - cy.get("#invalidator").should("not.be.visible"); - cy.get("#claim-loader").should("not.be.visible"); - cy.get("#view-claim").should("not.be.visible"); + cy.get(".invalidator").should("not.be.visible"); + cy.get(".claim-loader").should("not.be.visible"); + cy.get(".view-claim").should("not.be.visible"); cy.get("body", { timeout: 3000 }).should("contain.text", "Please use a web3 enabled browser to collect this reward."); }); @@ -79,9 +79,9 @@ function testUserAgent(userAgent: string) { }); cy.wait(2000); - cy.get("#invalidator").should("not.be.visible"); - cy.get("#claim-loader").should("not.be.visible"); - cy.get("#view-claim").should("not.be.visible"); + cy.get(".invalidator").should("not.be.visible"); + cy.get(".claim-loader").should("not.be.visible"); + cy.get(".view-claim").should("not.be.visible"); cy.get("body", { timeout: 3000 }).should("contain.text", "Please use a mobile-friendly Web3 browser such as MetaMask to collect this reward"); } diff --git a/cypress/e2e/claim-portal-success.cy.ts b/cypress/e2e/claim-portal-success.cy.ts index 1f715b3e..b9cb6263 100644 --- a/cypress/e2e/claim-portal-success.cy.ts +++ b/cypress/e2e/claim-portal-success.cy.ts @@ -17,21 +17,21 @@ describe("Claims Portal Success", () => { }); describe("Success", () => { it("should successfully claim a permit", () => { - cy.get("#additionalDetails", { timeout: 15000 }).should("be.visible").invoke("click"); + cy.get(".additional-details", { timeout: 15000 }).first().should("be.visible").invoke("click"); - cy.get('table[data-make-claim="ok"]').should("exist").and("include.text", "337888.4 WXDAI"); + cy.get('table[data-make-claim="ok"]').first().should("exist").and("include.text", "337888.4 WXDAI"); - cy.get("button[id='make-claim']").invoke("click"); + cy.get("button[class='make-claim']").first().invoke("click"); - cy.get("#invalidator").should("not.be.visible"); + cy.get(".invalidator").first().should("not.be.visible"); - cy.get("#claim-loader").should("be.visible").as("loader"); + cy.get(".claim-loader").first().should("be.visible").as("loader"); cy.wait(5000); // required for the action to complete - cy.get("@loader").should("not.be.visible"); + cy.get("@loader").first().should("not.be.visible"); - cy.get("#view-claim").should("be.visible").and("include.text", "View Claim"); + cy.get(".view-claim").first().should("be.visible").and("include.text", "View Claim"); // anvil confirms it instantly so there is two notifications cy.get("body", { timeout: 15000 }).should("contain.text", "Transaction sent"); @@ -41,10 +41,13 @@ describe("Claims Portal Success", () => { win.open = cy.stub().as("open"); }); - cy.get("#view-claim") + cy.get(".view-claim") + .first() .invoke("click") .then(() => { - cy.get("@open").should("be.calledWithMatch", /https:\/\/blockscan.com\/tx/); + cy.get("@open") + .first() + .should("be.calledWithMatch", /https:\/\/blockscan.com\/tx/); }); }); }); @@ -54,17 +57,17 @@ describe("Claims Portal Success", () => { cy.visit(`/${notMeantForYouPermit}`).then(() => { cy.wait(2000); }); - cy.get("#additionalDetails", { timeout: 15000 }).should("be.visible").invoke("click"); + cy.get(".additional-details", { timeout: 15000 }).first().should("be.visible").invoke("click"); - cy.get('table[data-make-claim="ok"]').should("exist"); + cy.get('table[data-make-claim="ok"]').first().should("exist"); - cy.get("button[id='make-claim']").invoke("click"); + cy.get("button[class='make-claim']").first().invoke("click"); - cy.get("#invalidator").should("not.be.visible"); + cy.get(".invalidator").first().should("not.be.visible"); - cy.get("#claim-loader").should("be.visible"); + cy.get(".claim-loader").first().should("be.visible"); - cy.get("#view-claim").should("not.be.visible"); + cy.get(".view-claim").first().should("not.be.visible"); cy.get("body", { timeout: 15000 }).should("contain.text", "This reward is not for you"); }); @@ -79,16 +82,16 @@ describe("Claims Portal Success", () => { cy.visit(`/${notMeantForYouPermit}`).then(() => { cy.wait(2000); }); - cy.get("#additionalDetails", { timeout: 15000 }).should("be.visible").invoke("click"); + cy.get(".additional-details", { timeout: 15000 }).first().should("be.visible").invoke("click"); - cy.get('table[data-make-claim="ok"]').should("exist"); + cy.get('table[data-make-claim="ok"]').first().should("exist"); - cy.get("#invalidator").should("be.visible").invoke("click"); + cy.get(".invalidator").should("be.visible").first().invoke("click"); - cy.get("#claim-loader").should("not.be.visible"); - cy.get("#view-claim").should("not.be.visible"); + cy.get(".claim-loader").first().should("not.be.visible"); + cy.get(".view-claim").first().should("not.be.visible"); - cy.get("body", { timeout: 15000 }).should("contain.text", "Nonce invalidation transaction sent"); + cy.get("body", { timeout: 15000 }).first().should("contain.text", "Nonce invalidation transaction sent"); }); }); }); diff --git a/static/index.html b/static/index.html index 9bbb8acc..6c63ef1c 100644 --- a/static/index.html +++ b/static/index.html @@ -30,6 +30,7 @@ Ubiquity Rewards | Ubiquity DAO +
@@ -67,19 +68,19 @@ - +
Amount
- +
Loading
- +
Token
- +
@@ -88,11 +89,11 @@ - +
For
- +
@@ -104,10 +105,10 @@ - +
- - - -
-