From b3757c3396a8351c51e5bce0c96934505081a311 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 16 Jun 2023 22:55:45 +0800 Subject: [PATCH] chore(playwrights): use pnpm exec over npx --- tests/playwright/package.json | 26 +++++++++---------- .../scripts/stressTestNewlyAddedTest.js | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/playwright/package.json b/tests/playwright/package.json index ab7f230a9e..45e4d1262e 100644 --- a/tests/playwright/package.json +++ b/tests/playwright/package.json @@ -4,21 +4,21 @@ "description": "", "main": "index.js", "scripts": { - "test": "TRACE=true npx playwright test --workers=4", - "test:fast": "npx playwright test --workers=6", - "test:shard:1": "TRACE=true npx playwright test --workers=4 --shard=1/2", - "test:shard:2": "TRACE=true npx playwright test --workers=4 --shard=2/2", - "test:repeat": "TRACE=true npx playwright test --workers=4 --repeat-each=12", + "test": "TRACE=true pnpm exec playwright test --workers=4", + "test:fast": "pnpm exec playwright test --workers=6", + "test:shard:1": "TRACE=true pnpm exec playwright test --workers=4 --shard=1/2", + "test:shard:2": "TRACE=true pnpm exec playwright test --workers=4 --shard=2/2", + "test:repeat": "TRACE=true pnpm exec playwright test --workers=4 --repeat-each=12", "test:quick": "TRACE=true PW_QUICK_TEST=1 npx playwright test --workers=4", - "test:debug": "./startPlayWrightServer.sh; PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console npx playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 0 --workers 1 --max-failures=1", - "test:debug:intelliJ": "TRACE=true PWDEBUG=console npx playwright test --trace on -c playwright.config.ts --headed --project=chromium --retries 0 --workers 1 --max-failures=1", + "test:debug": "./startPlayWrightServer.sh; PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console pnpm exec playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 0 --workers 1 --max-failures=1", + "test:debug:intelliJ": "TRACE=true PWDEBUG=console pnpm exec playwright test --trace on -c playwright.config.ts --headed --project=chromium --retries 0 --workers 1 --max-failures=1", "test:debug:watch": "npx nodemon -e ts -w ./ -x \"pnpm run test:debug\"", - "test:debug:quick:sqlite": "./startPlayWrightServer.sh; PW_QUICK_TEST=1 PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console npx playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 5 --workers 1 --max-failures=1", - "ci:test": "npx playwright test --workers=2", - "ci:test:shard:1": "npx playwright test --workers=2 --shard=1/2", - "ci:test:shard:2": "npx playwright test --workers=2 --shard=2/2", - "ci:test:mysql": "E2E_DB_TYPE=mysql npx playwright test --workers=2", - "ci:test:pg": "E2E_DB_TYPE=pg npx playwright test --workers=2" + "test:debug:quick:sqlite": "./startPlayWrightServer.sh; PW_QUICK_TEST=1 PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console pnpm exec playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 5 --workers 1 --max-failures=1", + "ci:test": "pnpm exec playwright test --workers=2", + "ci:test:shard:1": "pnpm exec playwright test --workers=2 --shard=1/2", + "ci:test:shard:2": "pnpm exec playwright test --workers=2 --shard=2/2", + "ci:test:mysql": "E2E_DB_TYPE=mysql pnpm exec playwright test --workers=2", + "ci:test:pg": "E2E_DB_TYPE=pg pnpm exec playwright test --workers=2" }, "keywords": [], "author": "", diff --git a/tests/playwright/scripts/stressTestNewlyAddedTest.js b/tests/playwright/scripts/stressTestNewlyAddedTest.js index 63dfa8d76b..e324047f19 100644 --- a/tests/playwright/scripts/stressTestNewlyAddedTest.js +++ b/tests/playwright/scripts/stressTestNewlyAddedTest.js @@ -29,7 +29,7 @@ void (async () => { // run all the tests by title using regex with exact match const { stdout: pwStdout } = await exec( - `PLAYWRIGHT_HTML_REPORT=playwright-report-stress E2E_DB_TYPE=${dbType} npx playwright test --repeat-each=2 --workers=2 -g "${testNames.join( + `PLAYWRIGHT_HTML_REPORT=playwright-report-stress E2E_DB_TYPE=${dbType} pnpm exec playwright test --repeat-each=2 --workers=2 -g "${testNames.join( '|' )}"` );