Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/govtool-frontend/playwright/lib/helpers/dRep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test.beforeEach(async () => {
});

enum SortOption {
Random = "Random",
Activity = "Activity",
RegistrationDate = "RegistrationDate",
VotingPower = "VotingPower",
Status = "Status",
Expand Down Expand Up @@ -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();

Expand All @@ -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
Expand All @@ -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();
Expand Down