From 39efa09e4b7476fef86d8bb1cbef82591c41f1ee Mon Sep 17 00:00:00 2001 From: Alyssa Weber Date: Sat, 27 Jun 2026 17:10:57 +0200 Subject: [PATCH 1/2] Add Playwright CI workflow for testing Workflow runs two pre-configured Playwright tests with a pre-made Recapp quiz. One playwright test contains a 5-second delay when answering each question, while the other test does not. A more optimized workflow is planned. --- .github/workflows/playwright.yml | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/playwright.yml diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 0000000..82edf9f --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,49 @@ +name: Run Playwright Tests + +on: + push: + branches: + - feature/implementing-playwright # Runs when pushing to playright branch for now + +jobs: + test: + name: Run Playwright Tests on Feature Branch + runs-on: ubuntu-latest + + steps: + - name: Checkout feature/implementing-playwright branch + uses: actions/checkout@v4 + with: + ref: feature/implementing-playwright + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Install Playwright system dependencies + run: npx playwright install-deps + + - name: Install Playwright browsers + run: npx playwright install chromium + + - name: Run Playwright Tests + run: | + npx playwright test \ + recapp/tests/e2e/anon-sixQ-ans-allCorrect.wait.spec.ts \ + recapp/tests/e2e/anon-sixQ-ans-halfCorrect.spec.ts \ + --workers 1 \ + --repeat-each 50 \ + --timeout 60000 \ + --trace on + + - name: Upload Test Report as Artifact + uses: actions/upload-artifact@v3 + with: + name: playwright-report + path: recapp/tests/e2e/test-report/ + if-no-files-found: ignore From fb469e1738cb0218d8c23a744e738a3f051307f5 Mon Sep 17 00:00:00 2001 From: Alyssa Weber Date: Mon, 19 Oct 2026 13:34:52 +0200 Subject: [PATCH 2/2] Enhance Playwright workflow with user credentials Updated Playwright workflow to include user credentials and separate test reports for user and anonymous tests. --- .github/workflows/playwright.yml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 82edf9f..6e43798 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -7,9 +7,15 @@ on: jobs: test: - name: Run Playwright Tests on Feature Branch + name: Run Playwright Tests on Feature Branch (Sequential) runs-on: ubuntu-latest + env: + PLAYWRIGHT_USERNAME: ${{ secrets.PLAYWRIGHT_USERNAME}} + PLAYWRIGHT_PASSWORD: ${{ secrets.PLAYWRIGHT_PASSWORD}} + PLAYWRIGHT_OTP_KEY: ${{ secrets.PLAYWRIGHT_OTP_KEY}} + PLAYWRIGHT_SHARE_URL: ${{ secrets.PLAYWRIGHT_SHARE_URL}} + steps: - name: Checkout feature/implementing-playwright branch uses: actions/checkout@v4 @@ -31,19 +37,29 @@ jobs: - name: Install Playwright browsers run: npx playwright install chromium - - name: Run Playwright Tests + - name: Run Playwright Test (with User Credentials) run: | npx playwright test \ - recapp/tests/e2e/anon-sixQ-ans-allCorrect.wait.spec.ts \ - recapp/tests/e2e/anon-sixQ-ans-halfCorrect.spec.ts \ + recapp/tests/e2e/user-sixQ-createQuiz.spec.ts \ --workers 1 \ - --repeat-each 50 \ - --timeout 60000 \ - --trace on + --timeout 180000 \ + --trace on \ + --output-dir=recapp/tests/e2e/test-report/user-test + - name: Run PLaywright Test (Anonymously) + run: | + npx playwright test \ + recapp/tests/e2e/anon-sixQ-create-sc.spec.ts \ + --workers 1 \ + --timeout 180000 \ + --trace on \ + --output-dir=recapp/tests/e2e/test-report/anon-test + - name: Upload Test Report as Artifact uses: actions/upload-artifact@v3 with: name: playwright-report - path: recapp/tests/e2e/test-report/ + path: | + recapp/tests/e2e/test-report/user-test/ + recapp/tests/e2e/test-report/anon-test/ if-no-files-found: ignore