-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.19.1 9.19.0
Node.js Version
20.19.2
Mode
WDIO Testrunner
Which capabilities are you using?
What happened?
When the browser launches, an error appears in the log that the sudo command could not be found. This error does not seem to lead to further problems, but it's generally bad practice for programs to make calls to sudo because:
- Sudo may not be installed on CI machines, especially containers (this is the case for our environment)
- Automated tests may not run as a user with sudo access
- Sudo access may cause a password prompt, which will hang automated tests
What is your expected behavior?
WebdriverIO should not use the sudo command to escalate permissions. If there are external dependencies, they should be documented
How to reproduce the bug.
Run WebdriverIO in a configuration which would cause xfvb autoinstall to trigger on any system that has neither xfvb nor sudo installed.
Relevant log output
2025-08-11T20:04:16.687Z ERROR @wdio/xvfb: Package installation command failed: Error: Command failed: sudo apk update && sudo apk add --no-cache xvfb-run
/bin/sh: sudo: not found
at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at ChildProcess.exithandler (node:child_process:422:12)
at ChildProcess.emit (node:events:524:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1104:16)
at Socket.<anonymous> (node:internal/child_process:456:11)
at Socket.emit (node:events:524:28)
at Socket.emit (node:domain:489:12)
at Pipe.<anonymous> (node:net:343:12)Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable