Skip to content

Commit 709571a

Browse files
committed
try fix args for running smoke
1 parent f0f3813 commit 709571a

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

apps/ehr/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"component-tests": "vitest --config ./vitest.config.component-tests.ts",
4040
"test": "npm run unit-tests -- --watch=false && npm run component-tests -- --watch=false",
4141
"e2e:login": "npm run e2e-skeleton ./tests/e2e/login",
42-
"e2e:specs": "npm run e2e-skeleton ./tests/e2e/specs",
43-
"e2e:specs:ui": "npm run e2e-skeleton ./tests/e2e/specs -- --ui",
42+
"e2e:specs": "npm run e2e-skeleton -- ./tests/e2e/specs $PLAYWRIGHT_EXTRA_ARGS",
43+
"e2e:specs:ui": "npm run e2e-skeleton -- ./tests/e2e/specs --ui $PLAYWRIGHT_EXTRA_ARGS",
4444
"e2e:manual-login": "node ./auth.setup.js",
4545
"e2e-skeleton": "env-cmd -f ./env/tests.${ENV}.json playwright test",
4646
"setup-test-deps": "node setup-test-deps.js",

apps/intake/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"lint": "NODE_OPTIONS='--max-old-space-size=8192' eslint --ext .ts,.tsx,.js,.jsx --report-unused-disable-directives --max-warnings 0 .",
3333
"lint:fix": "NODE_OPTIONS='--max-old-space-size=8192' eslint --ext .ts,.tsx,.js,.jsx --report-unused-disable-directives --max-warnings 0 --fix .",
3434
"e2e:login": "npm run e2e-skeleton ./tests/login/",
35-
"e2e:specs": "npm run e2e-skeleton ./tests/specs/",
36-
"e2e:specs:ui": "npm run e2e-skeleton ./tests/specs/ -- --ui",
35+
"e2e:specs": "npm run e2e-skeleton -- ./tests/specs/ $PLAYWRIGHT_EXTRA_ARGS",
36+
"e2e:specs:ui": "npm run e2e-skeleton -- ./tests/specs/ --ui $PLAYWRIGHT_EXTRA_ARGS",
3737
"e2e:specs:in-person": "npm run e2e-skeleton ./tests/specs/in-person/ -- --ui",
3838
"e2e:specs:telemed": "npm run e2e-skeleton ./tests/specs/telemed/ -- --ui",
3939
"e2e:manual-login": "node ./auth.setup.js",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"ehr:e2e:local": "tsx scripts/run-e2e.ts --app=ehr",
5858
"ehr:e2e:local:integration": "INTEGRATION_TEST=true tsx scripts/run-e2e.ts --app=ehr",
5959
"ehr:e2e:local:ui": "tsx scripts/run-e2e.ts --app=ehr --ui",
60+
"ehr:e2e:local:smoke": "SMOKE_TEST=true INTEGRATION_TEST=true tsx scripts/run-e2e.ts --app=ehr",
6061
"ehr:e2e:local:smoke:ui": "SMOKE_TEST=true INTEGRATION_TEST=true tsx scripts/run-e2e.ts --app=ehr --ui",
6162
"ehr:e2e:local:integration:ui": "INTEGRATION_TEST=true tsx scripts/run-e2e.ts --app=ehr --ui",
6263
"ehr:e2e:demo": "ENV=demo tsx scripts/run-e2e.ts --app=ehr",

scripts/run-e2e.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,22 @@ function createTestProcess(testType: 'login' | 'specs', appName: string): any {
230230
};
231231

232232
const baseArgs = commands[testType];
233-
const extraArgs = isUI ? [] : ['--', '--headed=false'];
233+
const extraArgs: string[] = [];
234+
235+
// Only add --headed if we want headed mode (UI mode)
236+
// By default Playwright runs headless, so we don't need to pass anything for headless
237+
if (isUI) {
238+
extraArgs.push('--headed');
239+
}
234240

235241
if (SMOKE_TEST === 'true' && testType !== 'login') {
236242
extraArgs.push('--grep', '@smoke');
237243
}
238244

239-
if (extraArgs.length > 0 && extraArgs[0] !== '--') {
240-
extraArgs.unshift('--');
241-
}
245+
// Build the playwright args as an environment variable for turbo to pass through
246+
const playwrightArgs = extraArgs.length > 0 ? extraArgs.join(' ') : '';
242247

243-
return spawn('turbo', [...baseArgs, ...extraArgs], {
248+
return spawn('turbo', baseArgs, {
244249
shell: true,
245250
stdio: 'inherit',
246251
env: {
@@ -250,6 +255,7 @@ function createTestProcess(testType: 'login' | 'specs', appName: string): any {
250255
IS_LOGIN_TEST: testType === 'login' ? 'true' : 'false',
251256
...(testType === 'specs' && { INTEGRATION_TEST }),
252257
SMOKE_TEST,
258+
PLAYWRIGHT_EXTRA_ARGS: playwrightArgs,
253259
},
254260
});
255261
}

0 commit comments

Comments
 (0)