Skip to content

Commit

Permalink
set env var?
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 committed Apr 4, 2024
1 parent ac97e3a commit b4a717b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/playwright-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,7 @@ async function runPlaywright(
const defaultArgs = {
config: configFile,
};
console.log(
'process.env.SAUCE_SYNC_WEB_ASSETS: ',
process.env.SAUCE_SYNC_WEB_ASSETS,
);
console.log('type: ', typeof process.env.SAUCE_SYNC_WEB_ASSETS);
if (process.env.SAUCE_SYNC_WEB_ASSETS !== 'true') {
if (runCfg.env?.SAUCE_SYNC_WEB_ASSETS !== 'true') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(defaultArgs as any).output = runCfg.playwrightOutputFolder;
}
Expand Down Expand Up @@ -334,20 +329,14 @@ async function runPlaywright(

runCfg.args = args;

console.log(
'process.env.SAUCE_SYNC_WEB_ASSETS: ',
process.env.SAUCE_SYNC_WEB_ASSETS,
);
console.log('type: ', typeof process.env.SAUCE_SYNC_WEB_ASSETS);

const env = {
...process.env,
...suite.env,
PLAYWRIGHT_JUNIT_OUTPUT_NAME: runCfg.junitFile,
SAUCE_REPORT_OUTPUT_NAME: runCfg.sauceReportFile,
FORCE_COLOR: '0',
SAUCE_WEB_ASSETS_DIR:
process.env.SAUCE_SYNC_WEB_ASSETS === 'true' ? runCfg.assetsDir : '',
runCfg.env?.SAUCE_SYNC_WEB_ASSETS === 'true' ? runCfg.assetsDir : '',
};

utils.setEnvironmentVariables(env);
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface RunnerConfig {

args: Record<string, unknown>;
artifacts: Artifacts;
env?: Record<string, string>;
}

export interface Suite {
Expand Down

0 comments on commit b4a717b

Please sign in to comment.