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 cd92836
Showing 1 changed file with 3 additions and 0 deletions.
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.logs = 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' : ''} when running Playwright.`, 1)

Check failure on line 45 in packages/playwright-core/src/server/firefox/firefox.ts

View workflow job for this annotation

GitHub Actions / docs & lint

Missing semicolon
if (error.logs.includes('no DISPLAY environment variable specified'))
error.logs = '\n' + wrapInASCIIBox(kNoXServerRunningError, 1);
return error;
Expand Down

0 comments on commit cd92836

Please sign in to comment.