From 9f483ff7551d2a3ddb8bc4bcdac02729bede71cd Mon Sep 17 00:00:00 2001 From: Marc Emmanuel Date: Fri, 23 Jan 2026 12:49:46 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/playwright.yml | 4 ++-- e2e/layers.spec.ts | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 0b87512d..a78b3a7a 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -10,13 +10,13 @@ jobs: - uses: actions/checkout@v5 - uses: actions/setup-node@v5 with: - node-version: lts/* + node-version: '24' - name: Install dependencies run: npm ci - name: Install Playwright Browsers run: playwright install --with-deps - name: Run Playwright tests - run: playwright test + run: npm run test:e2e - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: diff --git a/e2e/layers.spec.ts b/e2e/layers.spec.ts index a9fa0901..8c29df88 100644 --- a/e2e/layers.spec.ts +++ b/e2e/layers.spec.ts @@ -12,6 +12,13 @@ test.describe('map layers', () => { }) // Navigate with seed parameter + // NOTE: + // - We use a fixed seed ("test-seed") to make map generation deterministic for snapshot tests. + // - The resulting snapshots are platform-specific (Playwright stores them with suffixes such as + // "-darwin", "-linux", "-win32"). + // - Currently, only macOS ("-darwin") snapshots may be present in the repository. On other + // platforms (Linux/Windows), you must generate/update the corresponding snapshots for the + // tests to pass, or configure Playwright to use per-platform snapshot directories. await page.goto('/?seed=test-seed') const mapElement = page.locator('#map') @@ -21,7 +28,6 @@ test.describe('map layers', () => { await expect(mapElement.locator('#terrs')).toBeAttached({ timeout: 30000 }) await expect(mapElement.locator('#labels')).toBeAttached() await expect(page.locator('#loading')).toBeHidden({ timeout: 30000 }) - await page.waitForTimeout(1000) }) // Ocean and water layers