Skip to content

Commit

Permalink
Playwright screenshot script - use local chromium (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
signed-long authored and sarem-h committed Jul 6, 2024
1 parent 6417fa9 commit 15b87fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
- name: take screenshots
run: |
bun install --frozen-lockfile
bun playwright install chromium
node src/ci/screenshots.cjs https://${{ steps.pr.outputs.result }}.connect-d5y.pages.dev ${{ github.workspace }}/ci-artifacts
- name: Push Screenshots
Expand Down
4 changes: 2 additions & 2 deletions src/ci/screenshots.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ async function takeScreenshots(deviceType, context) {
}

(async () => {
const mobile_browser = await chromium.launch()
const mobile_browser = await chromium.launch({ executablePath: "/usr/bin/chromium"})
const iphone_13 = devices['iPhone 13']
const mobile_context = await mobile_browser.newContext(iphone_13)
await takeScreenshots('mobile', mobile_context)
await mobile_browser.close()

const desktop_browser = await chromium.launch()
const desktop_browser = await chromium.launch({ executablePath: "/usr/bin/chromium"})
const desktop_context = await desktop_browser.newContext({viewport: { width: 1920, height: 1080 }})
await takeScreenshots('desktop', desktop_context)
await desktop_browser.close()
Expand Down

0 comments on commit 15b87fe

Please sign in to comment.