diff --git a/apps/react-starter/e2e/devices.e2e.ts b/apps/react-starter/e2e/devices.e2e.ts index 9c279d2..747a518 100644 --- a/apps/react-starter/e2e/devices.e2e.ts +++ b/apps/react-starter/e2e/devices.e2e.ts @@ -5,9 +5,16 @@ async function filterDevicePageByDeviceName(page: Page, deviceName: string) { const filterInput = filter.locator("input"); await filterInput.fill("deviceName"); + + const dropdown = filter.locator("ix-dropdown"); + await expect(dropdown.getByText("Categories")).toBeVisible(); + await page.keyboard.press("Tab"); await page.keyboard.press("Enter"); + await expect(filter.locator("ix-dropdown").getByText("Categories")).not.toBeVisible(); + await expect(filter.locator("ix-dropdown").getByText("deviceName")).toBeVisible(); + await filterInput.fill(deviceName); await page.keyboard.press("Enter"); await page.mouse.click(0, 0); @@ -18,11 +25,16 @@ async function filterDevicePageByDeviceName(page: Page, deviceName: string) { test("filter for specific deviceName", async ({ page }) => { await page.goto("http://localhost:5173/#/devices"); - await filterDevicePageByDeviceName(page, "s71200"); - const aggrid = page.locator(".ag-root-wrapper"); const rows = aggrid.locator(".ag-center-cols-container .ag-row"); + await expect(rows).toHaveCount(22, { + // AG-Grid takes some time to filter the rows + timeout: 500, + }); + + await filterDevicePageByDeviceName(page, "s71200"); + await expect(rows).toHaveCount(1, { // AG-Grid takes some time to filter the rows timeout: 500, diff --git a/apps/react-starter/playwright.config.ts b/apps/react-starter/playwright.config.ts index 287a81b..66de805 100644 --- a/apps/react-starter/playwright.config.ts +++ b/apps/react-starter/playwright.config.ts @@ -24,7 +24,7 @@ export default defineConfig({ /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: "html", + reporter: "list", /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ diff --git a/apps/react-starter/src/util/mock-api.ts b/apps/react-starter/src/util/mock-api.ts index 0d96c5d..20402b9 100644 --- a/apps/react-starter/src/util/mock-api.ts +++ b/apps/react-starter/src/util/mock-api.ts @@ -9,7 +9,7 @@ import type { MockData } from "../types"; export const fetchDataSheet = async (): Promise => { - const res = await fetch(`${import.meta.env.BASE_URL}/data.json`); + const res = await fetch(`${import.meta.env.BASE_URL}data.json`); const text = await res.text(); if (res.status !== 200) {