From a2f3e55b6557013cb79ae2db5acf5915fdda7ca7 Mon Sep 17 00:00:00 2001 From: Praveen K B Date: Fri, 15 Nov 2024 16:28:38 +0530 Subject: [PATCH] Added server run check --- .github/workflows/playwright.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 320b2fb3..617b2803 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -24,20 +24,20 @@ jobs: - name: Install Playwright Browsers run: pnpm exec playwright install --with-deps - name: Start the development server - run: pnpm run dev & + run: | + pnpm run dev -- --host --port $PORT > vite.log 2>&1 & + echo $! > vite.pid env: PORT: 3001 VITE_PARSEABLE_URL: https://demo.parseable.com VITE_BASIC_AUTH: true VITE_USERNAME: admin VITE_PASSWORD: admin - - name: Echo + - name: Wait for the server to be ready run: | - echo "PORT: $PORT" - echo "VITE_PARSEABLE_URL: $VITE_PARSEABLE_URL" - echo "VITE_BASIC_AUTH: $VITE_BASIC_AUTH" - echo "VITE_USERNAME: $VITE_USERNAME" - echo "VITE_PASSWORD: $VITE_PASSWORD" + timeout 30 bash -c 'until curl -sf http://localhost:$PORT; do sleep 1; done' + - name: Run Playwright tests + run: pnpm exec playwright test - name: Run Playwright tests run: pnpm exec playwright test - uses: actions/upload-artifact@v4