I am learning TestCafe and I am new to it.
I am trying to follow as it is mentioned here: https://devexpress.github.io/testcafe/documentation/recipes/access-environment-variables-in-tests.html
I have a code that runs on my windows machine!!
fixture`Getting Started`.page`http://devexpress.github.io/testcafe/example`;
test("My First Test", async t => {
await t
.typeText('#developer-name', 'John Smith')
.click('#submit-button')
.takeScreenshot();
const articleHeader = await Selector('.result-content').find('h1');
// Obtain the text of the article header
let headerText = await articleHeader.innerText;
console.log(process.env.DEV_MODE);
});
My Scripts Section is like this
"scripts": {
"setnode": "set DEV_MODE=staging",
"test:chrome": "npm run setnode & npx testcafe \"chrome --start-fullscreen\" e2e/tests"
}
when I am running this command npm run test:chrome
I am getting output like this
ui-testcafe-poc@1.0.0 setnode C:\TestCafeProjects\ui-testcafe-poc set DEV_MODE=staging
Running tests in:
- Chrome 79.0.3945.130 / Windows 10
Getting Started
undefined
ā My First Test
why the console.log is writing as undefined instead of staging?