diff --git a/apps/potlock/widget/ModalDonation/AmountInput.jsx b/apps/potlock/widget/ModalDonation/AmountInput.jsx
index c2383c94..7c5c8828 100644
--- a/apps/potlock/widget/ModalDonation/AmountInput.jsx
+++ b/apps/potlock/widget/ModalDonation/AmountInput.jsx
@@ -116,6 +116,7 @@ const AmountInput = (props) => {
value={value}
placeholder="0"
onChange={(e) => HandleAmoutChange(e.target.value)}
+ name="amount"
/>
{" "}
diff --git a/playwright-tests/tests/donate.spec.js b/playwright-tests/tests/donate.spec.js
index 751e3d1d..bd932b5f 100644
--- a/playwright-tests/tests/donate.spec.js
+++ b/playwright-tests/tests/donate.spec.js
@@ -9,19 +9,32 @@ test("should open donate modal", async ({ page }) => {
test.setTimeout(120000); // 2 minutes... we want to improve performance
await page.goto(`${ROOT_SRC}?tab=project&projectId=${DEFAULT_PROJECT_ID}`);
await page.getByRole("button", { name: "Donate" }).click();
- expect(await page.isVisible("text=Donate to project")).toBeTruthy();
+ expect(await page.isVisible("text=Donate to")).toBeTruthy();
});
test("project with no active pot should donate direct with correct amount", async ({ page }) => {
test.setTimeout(120000); // 2 minutes... we want to improve performance
+
+ // go to project page (PotLock project)
await page.goto(`${ROOT_SRC}?tab=project&projectId=${DEFAULT_PROJECT_ID}`);
+
+ // click donate button
await page.getByRole("button", { name: "Donate" }).click();
- expect(await page.isVisible("text=Donate to project")).toBeTruthy();
+
+ // wait for modal to appear
+ expect(await page.isVisible("text=Donate to")).toBeTruthy();
+
+ // input amount
await page.fill("input[name=amount]", "100");
- await page.getByRole("button", { name: "Donate" }).nth(1).click();
+
+ await page.getByRole("button", { name: "Proceed to donate" }).click();
+
+ // Confirm Donation
+ await page.getByRole("button", { name: "Confirm donation" }).click();
// Confirmation modal should be visible
const transactionObj = JSON.parse(await page.locator("div.modal-body code").innerText());
+ // check if transaction object is correct
expect(transactionObj).toMatchObject({
bypass_protocol_fee: false,
message: "",
diff --git a/playwright-tests/tests/pot.spec.js b/playwright-tests/tests/pot.spec.js
index e7befc8d..e7ad8968 100644
--- a/playwright-tests/tests/pot.spec.js
+++ b/playwright-tests/tests/pot.spec.js
@@ -6,13 +6,21 @@ import { test, expect } from "@playwright/test";
import { ROOT_SRC, DEFAULT_POT_ID } from "../util/constants";
test.beforeEach(async ({ page }) => {
- await page.goto(`${ROOT_SRC}?tab=pot&potId=${DEFAULT_POT_ID}`);
+ await page.goto(`${ROOT_SRC}?tab=pot&potId=${DEFAULT_POT_ID}&nav=projects`);
});
-test("clicking pot card should go to pot page", async ({ page }) => {
- await page.getByText("NEAR Retroactive Builders").click();
+test("clicking project card should go to project page", async ({ page }) => {
+ test.setTimeout(120000); // 1 minute... we want to improve performance
- const url = page.url();
+ const projectSearchBar = await page.getByPlaceholder("Search projects");
- expect(url).toContain("?tab=pot&potId=build.v1.potfactory.potlock.near");
+ await projectSearchBar.fill("magic");
+
+ const projectCard = page.getByText("MagicBuild");
+
+ await Promise.all([projectCard.click(), page.waitForLoadState("load")]);
+
+ const projectUrl = page.url();
+
+ expect(projectUrl).toContain("?tab=project&projectId=magicbuild");
});
diff --git a/playwright-tests/tests/pots.spec.js b/playwright-tests/tests/pots.spec.js
index 0470dfd5..be7ee868 100644
--- a/playwright-tests/tests/pots.spec.js
+++ b/playwright-tests/tests/pots.spec.js
@@ -10,7 +10,9 @@ test.beforeEach(async ({ page }) => {
});
test("clicking pot card should go to pot page", async ({ page }) => {
- await page.getByText("NEAR Retroactive Builders").click();
+ const potCard = await page.getByText("NEAR Retroactive Builders");
+
+ await Promise.all([potCard.click(), page.waitForLoadState("load")]);
const url = page.url();