From 0727de4b357407ccc4c95a43edfa17cfbb48b2a2 Mon Sep 17 00:00:00 2001 From: IiroP Date: Thu, 10 Oct 2024 17:50:28 +0300 Subject: [PATCH] Tests can automatically start server --- .github/workflows/playwright.yml | 3 --- .gitignore | 2 ++ package.json | 2 +- tests/package.json | 5 +++-- tests/playwright.config.ts | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index fe92e0d7..66d684bf 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -12,12 +12,9 @@ jobs: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - with: - version: 9.6.0 - uses: actions/setup-node@v4 with: - node-version: 22 cache: "pnpm" - name: Install dependencies diff --git a/.gitignore b/.gitignore index 94769fa8..a2c4008c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ public/dist .vscode !.vscode/extensions.json .idea +playwright-report +test-results diff --git a/package.json b/package.json index 9b4e2d4f..b8f28abb 100644 --- a/package.json +++ b/package.json @@ -48,4 +48,4 @@ } } } -} +} \ No newline at end of file diff --git a/tests/package.json b/tests/package.json index cdf0cced..369aa249 100644 --- a/tests/package.json +++ b/tests/package.json @@ -3,11 +3,12 @@ "version": "0.0.0", "private": true, "scripts": { - "test": "playwright test --repeat-each=100" + "test_full": "playwright test --repeat-each=100", + "test": "playwright test" }, "devDependencies": { "@playwright/test": "catalog:", "@tietokilta/config-typescript": "workspace:*", "@types/node": "catalog:" } -} +} \ No newline at end of file diff --git a/tests/playwright.config.ts b/tests/playwright.config.ts index ebeae534..02039866 100644 --- a/tests/playwright.config.ts +++ b/tests/playwright.config.ts @@ -63,9 +63,9 @@ export default defineConfig({ ], /* Run your local dev server before starting the tests */ - // webServer: { - // command: 'npm run start', - // url: 'http://127.0.0.1:3000', - // reuseExistingServer: !process.env.CI, - // }, + webServer: { + command: 'pnpm -C ../ dev', + url: 'http://127.0.0.1:3000', + //reuseExistingServer: !process.env.CI, + }, });