mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-05 01:51:23 +01:00
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
93e7b9d3dd
commit
9f483ff755
2 changed files with 9 additions and 3 deletions
4
.github/workflows/playwright.yml
vendored
4
.github/workflows/playwright.yml
vendored
|
|
@ -10,13 +10,13 @@ jobs:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-node@v5
|
- uses: actions/setup-node@v5
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
node-version: '24'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
run: playwright install --with-deps
|
run: playwright install --with-deps
|
||||||
- name: Run Playwright tests
|
- name: Run Playwright tests
|
||||||
run: playwright test
|
run: npm run test:e2e
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ test.describe('map layers', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Navigate with seed parameter
|
// 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')
|
await page.goto('/?seed=test-seed')
|
||||||
|
|
||||||
const mapElement = page.locator('#map')
|
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('#terrs')).toBeAttached({ timeout: 30000 })
|
||||||
await expect(mapElement.locator('#labels')).toBeAttached()
|
await expect(mapElement.locator('#labels')).toBeAttached()
|
||||||
await expect(page.locator('#loading')).toBeHidden({ timeout: 30000 })
|
await expect(page.locator('#loading')).toBeHidden({ timeout: 30000 })
|
||||||
await page.waitForTimeout(1000)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Ocean and water layers
|
// Ocean and water layers
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue