Skip to content

Commit 81f8378

Browse files
committed
chore: assert dRep ID card display before view button click
1 parent 20ebc9c commit 81f8378

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ test("2N. Should show DRep information on details page", async ({
8686

8787
await dRepRegistrationPage.confirmBtn.click();
8888

89+
// Add an assertion to prevent clicking on "View Your dRep Details".
90+
await expect(
91+
dRepPage.getByTestId("dRep-id-display-card-dashboard")
92+
).toContainText(wallet.dRepId, { timeout: 10_000 });
8993
await dRepPage.getByTestId("view-drep-details-button").click();
9094

9195
// Verification

tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test.describe("Logged in DReps", () => {
3232

3333
await expect(
3434
page.getByTestId("dRep-id-display-card-dashboard")
35-
).toContainText(dRep01Wallet.dRepId);
35+
).toContainText(dRep01Wallet.dRepId, { timeout: 10_000 });
3636

3737
const governanceActionsPage = new GovernanceActionsPage(page);
3838

@@ -53,6 +53,11 @@ test.describe("Logged in DReps", () => {
5353

5454
await page.goto("/");
5555

56+
// Add an assertion to prevent clicking on "View Your dRep Details".
57+
await expect(
58+
page.getByTestId("dRep-id-display-card-dashboard")
59+
).toContainText(dRep01Wallet.dRepId, { timeout: 10_000 });
60+
5661
await page.getByTestId("view-drep-details-button").click();
5762
await page.getByTestId("edit-drep-data-button").click();
5863
const editDRepPage = new DRepRegistrationPage(page);

0 commit comments

Comments
 (0)