Masood
February 26, 2020, 4:11pm
1
HI
Does anyone can help me on fixing below error, am new to this configuration
HEADLESS=true npx codecept run
HEADLESS=true : The term ‘HEADLESS=true’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1
mirao
February 26, 2020, 6:04pm
2
The examples should be compatible with Linux and MacOS.
What’s your OS?
Masood
February 27, 2020, 5:27am
3
i am on Windows 10, i thought its just .env configuration, is there any way i can use these arguments?
Thank you for your response
mirao
February 27, 2020, 6:03pm
4
You can try:
set HEADLESS=true
npx codeceptjs run
Masood
February 28, 2020, 4:20am
5
Thank you so much, it worked.
Michel
March 13, 2020, 8:06pm
6
For me, I need to use this command: $env:HEADLESS=“true”
Nothing seems to be working for me:
const { setHeadlessWhen } = require(’@codeceptjs /configure’);
setHeadlessWhen(process.env.HEADLESS);
exports.config = {
output: ‘./output’,
helpers: {
Playwright: {
url: 'https://www.steadfast.com.au/',
show: true,
browser: 'chromium'
},
It always takes what is mentioned inside Playwright settings.
I am trying this on my windows 10 machine:
$env:HEADLESS=“true”; npx codeceptjs run --steps
$env:HEADLESS=“false”; npx codeceptjs run --steps
And in both the cases, the tests run in headless mode.
42Mo
November 29, 2021, 9:36am
9
That’s because environment variables are always strings and setHeadlessWhen dont do type conversion. Set $env:HEADLESS = ""
for workaround.
@davert , worth the change?
1 Like