Skip to content

Commit d50e2f5

Browse files
authored
Merge pull request #3072 from IntersectMBO/bugfix/fetch-active-dRep
fix: remove unnecessary filter in fetchFirstActiveDRepDetails ,add scroll to page and show correct message in revote "5E" test
2 parents 4e7ace7 + bcf860a commit d50e2f5

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

tests/govtool-frontend/playwright/lib/helpers/dRep.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ export async function fetchFirstActiveDRepDetails(page: Page) {
3333

3434
dRepDirectoryPage = new DRepDirectoryPage(page);
3535
await dRepDirectoryPage.goto();
36-
await dRepDirectoryPage.filterBtn.click();
37-
await page.getByTestId("Active-checkbox").click();
3836
await responsePromise;
3937

4038
await dRepDirectoryPage.searchInput.click();

tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ test.describe("Perform voting", () => {
178178

179179
await governanceActionsPage.votedTab.click();
180180

181+
await govActionDetailsPage.currentPage.evaluate(() =>
182+
window.scrollTo(0, 500)
183+
);
184+
181185
await expect(
182186
govActionDetailsPage.currentPage.getByTestId("my-vote").getByText("Yes")
183187
).toBeVisible();
@@ -191,10 +195,19 @@ test.describe("Perform voting", () => {
191195
.getByText("No")
192196
.isVisible();
193197

198+
const textContent = await govActionDetailsPage.currentPage
199+
.getByTestId("my-vote")
200+
.textContent();
201+
202+
await govActionDetailsPage.currentPage.evaluate(() =>
203+
window.scrollTo(0, 500)
204+
);
194205
await expect(
195206
govActionDetailsPage.currentPage.getByTestId("my-vote").getByText("No"),
196207
{
197-
message: !isNoVoteVisible && "No vote not visible",
208+
message:
209+
!isNoVoteVisible &&
210+
`"No" vote not visible, current vote status: ${textContent.match(/My Vote:(Yes|No)/)[1]}`,
198211
}
199212
).toBeVisible({ timeout: 60_000 });
200213
});

0 commit comments

Comments
 (0)