From 5a7063b170b661da5480a5b45f47cdcaac39896e Mon Sep 17 00:00:00 2001 From: Praveen K B Date: Fri, 15 Nov 2024 16:58:41 +0530 Subject: [PATCH] Changed playwright config --- .github/workflows/playwright.yml | 7 +++++++ playwright.config.ts | 15 --------------- vite.config.ts | 13 +++++++++++++ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 877c9aa4..1578db60 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -25,6 +25,13 @@ jobs: run: pnpm exec playwright install --with-deps - name: Run Playwright tests run: pnpm exec playwright test + env: + CI: true + PORT: 3001 + VITE_PARSEABLE_URL: https://demo.parseable.com + VITE_BASIC_AUTH: true + VITE_USERNAME: admin + VITE_PASSWORD: admin - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: diff --git a/playwright.config.ts b/playwright.config.ts index 7f1045be..551d737a 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -37,19 +37,4 @@ export default defineConfig({ // use: { ...devices['Desktop Safari'] }, // }, ], - - /* Run your local dev server before starting the tests */ - webServer: { - command: 'pnpm run dev', - url: 'http://localhost:3001', - reuseExistingServer: false, - timeout: 120000, // Increase timeout for server startup - env: { - PORT: '3001', - VITE_PARSEABLE_URL: 'https://demo.parseable.com', - VITE_BASIC_AUTH: 'true', - VITE_USERNAME: 'admin', - VITE_PASSWORD: 'admin', - }, - }, }); diff --git a/vite.config.ts b/vite.config.ts index 94cc3d80..b627f3fc 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,6 +4,19 @@ import path from 'path'; // https://vitejs.dev/config/ export default defineConfig({ + server: { + host: true, + port: 3001, + strictPort: true, + headers: { + 'Access-Control-Allow-Origin': '*', + }, + }, + preview: { + port: 3001, + strictPort: true, + }, + clearScreen: false, plugins: [react()], resolve: { alias: {