Skip to content

Commit

Permalink
chore(firefox): rewrite error message for $HOME directory ownership m…
Browse files Browse the repository at this point in the history
…ismatch
  • Loading branch information
mxschmitt committed Jan 9, 2024
1 parent a519af6 commit 066532b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
playwright:
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:next-jammy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install dependencies
run: npm run build
- name: Run your tests
run: npm ci
working-directory: examples/todomvc
- name: Run your tests
run: npx playwright test
working-directory: examples/todomvc
3 changes: 3 additions & 0 deletions packages/playwright-core/src/server/firefox/firefox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export class Firefox extends BrowserType {
_doRewriteStartupLog(error: ProtocolError): ProtocolError {
if (!error.logs)
return error;
// https://github.com/microsoft/playwright/issues/6500
if (error.logs.includes(`as root in a regular user's session is not supported.`))
error.message = wrapInASCIIBox(`Firefox is unable to launch if the $HOME folder isn't owned by the current user.\nWorkaround: Set the HOME=/root environment variable${process.env.GITHUB_ACTION ? ' in your GitHub Actions workflow file' : ''}.`, 1) + '\n' + error.message;
if (error.logs.includes('no DISPLAY environment variable specified'))
error.logs = '\n' + wrapInASCIIBox(kNoXServerRunningError, 1);
return error;
Expand Down

0 comments on commit 066532b

Please sign in to comment.