You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
Docker has a specific requirements to launch browser with --no-sandbox and --disable-setuid-sandbox and I struggle to find a way of setting those options without making a fork and editing runtime/world.js.
For now I'm trying to modify global browser variable within a BeforeFeatures hook and it doesn't work.
module.exports=function(){this.registerHandler('BeforeFeatures',asyncfunction(){if(!global.browser){constoptions={args: [// Required for Docker version of Puppeteer'--headless','--no-sandbox','--disable-setuid-sandbox',// This will write shared memory files into /tmp instead of /dev/shm,// because Docker’s default for /dev/shm is 64MB'--disable-dev-shm-usage']}global.browser=awaitpuppeteer.launch(options)}})}
This code is located in step-definitions folder, hook is called and a browser variable contains a valid puppeteer object.
Yet the script fails with the following:
/node_modules/cucumber/lib/cucumber/runtime/event_broadcaster.js:30
process.nextTick(function(){ throw error; }); // prevent swallow by unhandled rejection
^
Error: node_modules/puppeteer-cucumber-js/runtime/world.js:99 Failed to launch the browser process!
[48:48:0824/105830.997835:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/node_modules/puppeteer-cucumber-js/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
at Interface.<anonymous> (/node_modules/puppeteer-cucumber-js/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
at Interface.emit (events.js:327:22)
at Interface.close (readline.js:424:8)
at Socket.onend (readline.js:202:10)
at Socket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Any ideas?)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Docker has a specific requirements to launch browser with
--no-sandbox
and--disable-setuid-sandbox
and I struggle to find a way of setting those options without making a fork and editingruntime/world.js
.For now I'm trying to modify global
browser
variable within aBeforeFeatures
hook and it doesn't work.This code is located in step-definitions folder, hook is called and a
browser
variable contains a valid puppeteer object.Yet the script fails with the following:
Any ideas?)
The text was updated successfully, but these errors were encountered: