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
26 changes: 25 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,29 @@ jobs:
dist/
docs/

e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: build
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22.x'
cache: 'npm'
- run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps chromium
- name: Run e2e tests
run: npm run e2e
- name: Upload Playwright report
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 7
Comment thread
sanak marked this conversation as resolved.

gh-pages:
name: 'Host with GitHub Pages'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -87,6 +110,7 @@ jobs:
contents: read
needs:
- build
- e2e
- act-test
if: startsWith(github.ref, 'refs/tags/v')
steps:
Expand All @@ -113,7 +137,7 @@ jobs:
run: npm publish --access=public --tag=next

deploy:
needs: build
needs: [build, e2e]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')

Expand Down
3 changes: 2 additions & 1 deletion e2e/basic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { Geolonia } from '../src/embed';
import { TEST_URL, waitForMapLoad } from './helper';
import { TEST_URL, waitForMapLoad, waitForStyleLoad } from './helper';

declare global {
interface Window {
Expand Down Expand Up @@ -57,6 +57,7 @@ test.describe('1. 基本的な地図表示', () => {
test('1.4 アトリビューションが表示されていること', async ({ page }) => {
await page.goto(`${TEST_URL}/basic.html`);
await waitForMapLoad(page);
await waitForStyleLoad(page);

// CustomAttributionControl は Shadow DOM 内にアトリビューションを描画する
const attributionText = await page.evaluate(() => {
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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('/')`. */
Expand Down
Loading