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
It appears that when you assign to process.env.profile Node stringifies the value. So if options.profile is undefined then it gets stringified to "undefined" instead of resulting in the env not being set.
The text was updated successfully, but these errors were encountered:
What are you trying to achieve?
I wanted to control what browser is run using
--profile
and fallback to chrome if--profile
was not provided.What do you get instead?
I got errors like "Error: Cannot find the browser. "undefined:headless" is neither a known browser alias, nor a path to an executable file.".
I tried debugging by putting
console.log(process.env.profile, typeof process.env.profile);
in my codecept.conf.js and got "undefined string".Details
Investigation
I did a bit of debugging and it looks like the issue is the way that the run command (and other commands) set the profile.
CodeceptJS/lib/command/run.js
Lines 8 to 11 in 58bf5d9
It appears that when you assign to
process.env.profile
Node stringifies the value. So ifoptions.profile
is undefined then it gets stringified to "undefined" instead of resulting in the env not being set.The text was updated successfully, but these errors were encountered: