diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 0000000..6e43798 --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,65 @@ +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 (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 + 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 Test (with User Credentials) + run: | + npx playwright test \ + recapp/tests/e2e/user-sixQ-createQuiz.spec.ts \ + --workers 1 \ + --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/user-test/ + recapp/tests/e2e/test-report/anon-test/ + if-no-files-found: ignore