Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[investigate] Replace Puppeteer with Playwright (Vitest Browser Mode?) #4949

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ jobs:
with:
node-version-file: '.nvmrc'
- run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- run: npm run build-dist
- uses: actions/upload-artifact@v4
if: '!cancelled()'
Expand Down Expand Up @@ -117,6 +119,8 @@ jobs:
if: runner.os == 'Linux'
run: sudo apt install fonts-noto-cjk
- run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Start display server
if: runner.os == 'Linux'
run: nohup Xvfb &
Expand Down
15 changes: 8 additions & 7 deletions build/generate-doc-images.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import path from 'path';
import fs from 'fs';
import puppeteer from 'puppeteer';
import playwright from '@playwright/test';
import packageJson from '../package.json' with { type: 'json' };

const exampleName = process.argv[2];
const useLocalhost = (process.argv.length > 3) && (process.argv[3] === 'serve');
const examplePath = path.resolve('test', 'examples');

const browser = await puppeteer.launch({headless: true});

const page = await browser.newPage();
const browser = await playwright.chromium.launch({headless: true});
const context = await browser.newContext({
deviceScaleFactor: 2
});
const page = await context.newPage();
// set viewport and double deviceScaleFactor to get a closer shot of the map
await page.setViewport({
await page.setViewportSize({
width: 600,
height: 250,
deviceScaleFactor: 2
height: 250
});

async function createImage(exampleName) {
Expand Down
Loading
Loading