diff --git a/config/wp.config.sample.ts b/config/wp.config.sample.ts index bcbc33b..6e2c05c 100755 --- a/config/wp.config.sample.ts +++ b/config/wp.config.sample.ts @@ -42,7 +42,8 @@ const { WP_SSH_USERNAME = '', WP_SSH_ADDRESS = '', WP_SSH_KEY = '', - WP_SSH_ROOT_DIR = '' + WP_SSH_ROOT_DIR = '', + E2E_HEADLESS= true } = process.env; /** @@ -100,5 +101,6 @@ export { WP_SSH_ADDRESS, WP_SSH_KEY, WP_SSH_ROOT_DIR, - SCENARIO_URLS + SCENARIO_URLS, + E2E_HEADLESS }; \ No newline at end of file diff --git a/src/support/hooks.ts b/src/support/hooks.ts index da3ad56..cde063f 100644 --- a/src/support/hooks.ts +++ b/src/support/hooks.ts @@ -22,7 +22,7 @@ import { PageUtils } from "../../utils/page-utils"; import { batchUpdateVRTestUrl } from "../../utils/helpers"; import { deleteFolder } from "../../utils/helpers"; import backstop from 'backstopjs'; -import { SCENARIO_URLS } from "../../config/wp.config"; +import { SCENARIO_URLS, E2E_HEADLESS } from "../../config/wp.config"; import { After, AfterAll, Before, BeforeAll, Status, setDefaultTimeout } from "@cucumber/cucumber"; // import wp, {cp, deleteTransient, generateUsers, resetWP, rm, unzip} from "../../utils/commands"; @@ -43,7 +43,7 @@ setDefaultTimeout(process.env.PWDEBUG ? -1 : 60 * 10000); */ BeforeAll(async function (this: ICustomWorld) { await deleteFolder('./backstop_data/bitmaps_test'); - browser = await chromium.launch({ headless: false }); + browser = await chromium.launch({ headless: !!E2E_HEADLESS }); if (process.env.npm_config_vrurl === undefined) { await batchUpdateVRTestUrl({