From 371528a9fb121a93b4351bdf5fa910cf18faed4f Mon Sep 17 00:00:00 2001 From: nishtha-agarwal-211 Date: Wed, 3 Jun 2026 20:38:38 +0530 Subject: [PATCH] chore: add Playwright E2E tests, configure CI workflow, and resolve modal layout and focus-trap bugs --- .github/workflows/playwright.yml | 47 +++++++++++++++++ .gitignore | Bin 382 -> 428 bytes web-app/index.html | 7 +-- web-app/js/main.js | 14 +++-- web-app/js/projects/tic-tac-toe.js | 5 +- web-app/package-lock.json | 64 +++++++++++++++++++++++ web-app/package.json | 4 +- web-app/playwright.config.js | 40 ++++++++++++++ web-app/tests-e2e/modal.spec.js | 75 +++++++++++++++++++++++++++ web-app/tests-e2e/playground.spec.js | 32 ++++++++++++ web-app/tests-e2e/search.spec.js | 57 ++++++++++++++++++++ web-app/tests-e2e/theme.spec.js | 48 +++++++++++++++++ 12 files changed, 381 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/playwright.yml create mode 100644 web-app/playwright.config.js create mode 100644 web-app/tests-e2e/modal.spec.js create mode 100644 web-app/tests-e2e/playground.spec.js create mode 100644 web-app/tests-e2e/search.spec.js create mode 100644 web-app/tests-e2e/theme.spec.js diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 00000000..d3bc83d2 --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,47 @@ +name: Playwright E2E Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + timeout-minutes: 15 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + cd web-app + npm ci + + - name: Install Playwright Browsers + run: | + cd web-app + npx playwright install --with-deps + + - name: Run Playwright tests + run: | + cd web-app + npx playwright test + + - name: Upload Playwright Report + uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: web-app/playwright-report/ + retention-days: 30 diff --git a/.gitignore b/.gitignore index d50a3efe1b73246f17eee35022a4e35bce455e28..a6b609859f9c9ccef3cb3354a275eda0bcad1ddf 100644 GIT binary patch delta 57 zcmeyzw1#;@HKSocPGV(wQD%BZiEdG9L4Hw*K37sseiEEhl3EOsDK5<^Dc0v=;9>v( DdrTBP delta 11 ScmZ3({EulvH6t?v7XttoVgl&^ diff --git a/web-app/index.html b/web-app/index.html index c51f7a64..4dbf2ee6 100644 --- a/web-app/index.html +++ b/web-app/index.html @@ -402,7 +402,6 @@

Spot the Difference

-