diff --git a/tests/govtool-frontend/playwright/lib/helpers/dRep.ts b/tests/govtool-frontend/playwright/lib/helpers/dRep.ts index 262429552..90a08974e 100644 --- a/tests/govtool-frontend/playwright/lib/helpers/dRep.ts +++ b/tests/govtool-frontend/playwright/lib/helpers/dRep.ts @@ -17,8 +17,9 @@ export async function fetchFirstActiveDRepDetails(page: Page) { let dRepGivenName: string; let dRepId: string; let dRepDirectoryPage: DRepDirectoryPage; + let routePath = "**/drep/list?page=0&pageSize=5&sort=Activity&**"; await page.route( - "**/drep/list?page=0&pageSize=10&sort=Random&**", + routePath, async (route) => { const response = await route.fetch(); const json = await response.json(); @@ -40,7 +41,7 @@ export async function fetchFirstActiveDRepDetails(page: Page) { ); const responsePromise = page.waitForResponse( - "**/drep/list?page=0&pageSize=10&sort=Random&**" + routePath ); await functionWaitedAssert( diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts index b5b859ac2..5b53ef11c 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts @@ -13,7 +13,7 @@ test.beforeEach(async () => { }); enum SortOption { - Random = "Random", + Activity = "Activity", RegistrationDate = "RegistrationDate", VotingPower = "VotingPower", Status = "Status", @@ -51,7 +51,8 @@ test("2K_2. Should sort DReps", async ({ page }) => { ); }); -test("2K_3. Should sort DReps randomly", async ({ page }) => { +test("2K_3. Should sort DReps randomly (Deprecated)", async ({ page }) => { + test.skip() const dRepDirectory = new DRepDirectoryPage(page); await dRepDirectory.goto(); @@ -60,13 +61,13 @@ test("2K_3. Should sort DReps randomly", async ({ page }) => { await page.getByTestId(`${SortOption.RegistrationDate}-radio`).click(); const dRepList1: IDRep[] = await dRepDirectory.getDRepsResponseFromApi( - SortOption.Random + SortOption.Activity ); await page.getByTestId(`${SortOption.RegistrationDate}-radio`).click(); const dRepList2: IDRep[] = await dRepDirectory.getDRepsResponseFromApi( - SortOption.Random + SortOption.Activity ); // Extract dRepIds from both lists @@ -82,11 +83,12 @@ test("2K_3. Should sort DReps randomly", async ({ page }) => { expect(isOrderDifferent).toBe(true); }); -test("2O. Should load more DReps on show more", async ({ page }) => { +test("2O. Should load more DReps on show more (Deprecated)", async ({ page }) => { + test.skip(); const responsePromise = page.waitForResponse((response) => response .url() - .includes(`drep/list?page=1&pageSize=10&sort=${SortOption.Random}`) + .includes(`drep/list?page=1&pageSize=10&sort=${SortOption.Activity}`) ); const dRepDirectory = new DRepDirectoryPage(page); await dRepDirectory.goto();