Skip to content

[CLUST-350] Frontend UI testing with Network mocking - #172

Merged
nyan222727 merged 8 commits into
mainfrom
clust-350-frontend-ui-testing-with-network-mocking
Sep 4, 2026
Merged

[CLUST-350] Frontend UI testing with Network mocking#172
nyan222727 merged 8 commits into
mainfrom
clust-350-frontend-ui-testing-with-network-mocking

Conversation

@nyan222727

@nyan222727 nyan222727 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Type of changes

  • Test

Purpose

Add Playwright network-mocking tests for the mobile drawers.

The tests cover:

  • The admin user detail drawer
  • The Link Resources drawer
  • The Add Initial Members drawer

Additional Information

React Testing Library renders a simulated DOM rather than the application in a real browser. Therefore, it cannot reliably verify drawer behavior. Playwright runs the real frontend in a mobile browser while mocking backend requests.

Playwright folder structure

playwright.config.ts
e2e/
├── test-utils.ts
├── admin-user-drawer.spec.ts
└── create-group-drawers.spec.ts

How to run test

  pnpm install

Install the Playwright Chromium browser:

  pnpm exec playwright install chromium

Run all Playwright tests:

  pnpm test:e2e

Runs all Playwright end-to-end tests in the e2e/ directory. Playwright starts the Vite development server automatically, opens a mobile Chromium browser, and tests the application using mocked API responses.

For Arch Linux or other systems without Chromium dependencies, run the tests through Docker:

  docker run --rm \
    --ipc=host \
    --network=host \
    -v "$PWD:/work" \
    -v clustron-pnpm-store:/pnpm/store \
    -v /work/node_modules \
    -w /work \
    mcr.microsoft.com/playwright:v1.62.1-noble \
    bash -lc 'corepack enable &&
      pnpm config set store-dir /pnpm/store &&
      pnpm install --frozen-lockfile &&
      pnpm exec playwright test'

Preview Environment

https://pr-172.clustron.sdc.nycu.club

Preview Environment

https://pr-172.clustron.sdc.nycu.club

…cking tests for mobile drawers

  - Cover the admin user detail drawer
  - Cover the Link Resources drawer
  - Cover the Add Initial Members drawer
@nyan222727 nyan222727 self-assigned this Aug 21, 2026
@nyan222727 nyan222727 changed the title test: Set up Playwright [CLUST-350] Frontend UI testing with Network mocking Aug 21, 2026
Comment thread package.json Outdated
@nyan222727
nyan222727 marked this pull request as ready for review August 28, 2026 07:07
Comment thread playwright.config.ts
@nyan222727
nyan222727 merged commit 793a60b into main Sep 4, 2026
8 checks passed
@yukicoder0509
yukicoder0509 deleted the clust-350-frontend-ui-testing-with-network-mocking branch September 4, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants