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
25 changes: 24 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,34 @@ jobs:
test-results/
retention-days: 7

playwright-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.read-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Read locked Playwright version
id: read-version
shell: bash
run: |
version="$(node -p "require('./package-lock.json').packages['node_modules/@playwright/test'].version")"
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Unsupported Playwright version: $version" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"

screenshot-container:
needs: playwright-version
runs-on: ubuntu-latest
name: Screenshot check in container
timeout-minutes: 15
container:
image: mcr.microsoft.com/playwright:v1.63.0-noble
image: mcr.microsoft.com/playwright:v${{ needs.playwright-version.outputs.version }}-noble
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions scripts/generate-screenshots.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ export async function generateScreenshot() {
const server = await createServer()
await server.listen()

const browser = await chromium.launch()
let browser
try {
browser = await chromium.launch()
const context = await browser.newContext({
...devices['Desktop Chrome'],
locale: 'en-US',
Expand All @@ -43,8 +44,11 @@ export async function generateScreenshot() {

return await page.screenshot({ animations: 'disabled' })
} finally {
await browser.close()
await server.close()
try {
await browser?.close()
} finally {
await server.close()
}
}
}

Expand Down
Loading