test.beforeEach not getting called by running npx cross-env ENV=qa npm run test
asit-till opened this issue · 2 comments
asit-till commented
In below example on running " npx cross-env ENV=qa npm run test" beforeEach /afterEach not getting called. Is there any way ?
import test from "../../lib/BaseTest";
test.beforeEach(async ({ page }) => {
// Go to the starting url before each test.
console.log("In BEFORE");
});
test(`Login to PHP travels.`, async ({ loginPage, myAccountPage }) => {
await loginPage.navigateToURL();
await loginPage.loginToApplication();
await myAccountPage.verifyMyAccountHeader();
});
asit-till commented
It was the issue in global config and I managed to fix it.
asit-till commented
anyone wants to run test.beforeEach/After need to fix the global config