Skip to content

Commit

Permalink
feat: added navigation checks
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 committed Nov 22, 2023
1 parent df6dd28 commit 2910617
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 4 additions & 0 deletions e2e/tests/contants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ export const SERVICE_TABLE_HEADERS = {
ERROR_RATE: "Error Rate (% of total)",
OPS_PER_SECOND: "Operations Per Second",
};

export const DATA_TEST_IDS = {
NEW_DASHBOARD_BTN: "create-new-dashboard",
};
24 changes: 22 additions & 2 deletions e2e/tests/navigation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { test, expect } from "@playwright/test";
import ROUTES from "../../frontend/src/constants/routes";
import { SERVICE_TABLE_HEADERS } from "./contants";
import { DATA_TEST_IDS, SERVICE_TABLE_HEADERS } from "./contants";

test("Basic Navigation Check across different resources", async ({ page }) => {
// route to services page and check if the page renders fine with BE contract
await Promise.all([
page.goto(ROUTES.APPLICATION),
page.waitForRequest("**/v1/services"),
Expand All @@ -14,7 +15,26 @@ test("Basic Navigation Check across different resources", async ({ page }) => {

await expect(p99Latency).toBeVisible();

// route to the new trace explorer page and check if the page renders fine
await page.goto(ROUTES.TRACES_EXPLORER);

await page.pause();
await page.waitForLoadState("networkidle");

const listViewTable = await page
.locator('div[role="presentation"]')
.isVisible();

expect(listViewTable).toBeTruthy();

// route to the dashboards page and check if the page renders fine
await Promise.all([
page.goto(ROUTES.ALL_DASHBOARD),
page.waitForRequest("**/v1/dashboards"),
]);

const newDashboardBtn = await page
.locator(`data-testid=${DATA_TEST_IDS.NEW_DASHBOARD_BTN}`)
.isVisible();

expect(newDashboardBtn).toBeTruthy();
});

0 comments on commit 2910617

Please # to comment.