Skip to content

Commit

Permalink
Add better error message when chromium isn't found
Browse files Browse the repository at this point in the history
When the chromium isn't found, we say: "no command", which is confusing
to most users. This new error message tells the user that they have to
install a Chromium on their system to run browser tests.
  • Loading branch information
inancgumus committed Dec 13, 2023
1 parent 0fb9eae commit 16da1d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion chromium/browser_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,12 @@ func (b *BrowserType) allocate(
}

path := opts.ExecutablePath
if path == "" {
if strings.TrimSpace(path) == "" {
path = b.ExecutablePath()
}
if path == "" { // still empty?
return nil, fmt.Errorf("chromium is not installed on this system")
}

return common.NewLocalBrowserProcess(bProcCtx, path, args, dataDir, bProcCtxCancel, logger) //nolint: wrapcheck
}
Expand Down

0 comments on commit 16da1d2

Please sign in to comment.