Skip to content

Commit 3af09f5

Browse files
authored
Merge pull request #3722 from IntersectMBO/fix/4H-flaky-test
Fix: wrap governance action expiry test with function waited assertion
2 parents 820e0f0 + f339297 commit 3af09f5

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.spec.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,19 @@ test("4H. Should verify none of the displayed governance actions have expired",
199199
const govActionsPage = new GovernanceActionsPage(page);
200200
await govActionsPage.goto();
201201

202-
const proposalCards = await govActionsPage.getAllProposals();
203-
204-
for (const proposalCard of proposalCards) {
205-
const expiryDateEl = proposalCard.getByTestId("expiry-date");
206-
const expiryDateTxt = await expiryDateEl.innerText();
207-
const expiryDate = extractExpiryDateFromText(expiryDateTxt);
208-
const today = new Date();
209-
expect(today <= expiryDate).toBeTruthy();
210-
}
202+
await functionWaitedAssert(
203+
async () => {
204+
const proposalCards = await govActionsPage.getAllProposals();
205+
for (const proposalCard of proposalCards) {
206+
const expiryDateEl = proposalCard.getByTestId("expiry-date");
207+
const expiryDateTxt = await expiryDateEl.innerText();
208+
const expiryDate = extractExpiryDateFromText(expiryDateTxt);
209+
const today = new Date();
210+
expect(today <= expiryDate).toBeTruthy();
211+
}
212+
},
213+
{ name: "verify none expired governance actions" }
214+
);
211215
});
212216

213217
test("4K. Should display correct vote counts on governance details page for disconnect state", async ({

0 commit comments

Comments
 (0)