acupedia-store-ui/TESTING.md

54 lines
1.0 KiB
Markdown

# Running Storefront Tests (`acupedia_store_ui`)
All commands below should be run from the `acupedia_store_ui/` directory:
```bash
cd acupedia_store_ui
```
---
## 1. Prerequisites (First Time Only)
If dependencies or Playwright browsers are not installed yet:
```bash
npm install
npx playwright install chromium
```
---
## 2. Run Playwright E2E Tests
### Run all E2E tests (headless, Desktop + Mobile)
```bash
npm run test:e2e
```
> Playwright automatically starts the Vite dev server on `http://localhost:3000/store/` if it is not already running.
### Run in Interactive UI Mode (recommended for watching & debugging)
```bash
npm run test:e2e:ui
```
### Run in Headed Mode (watch the browser window)
```bash
npm run test:e2e:headed
```
### Run a specific test file
```bash
npx playwright test tests/e2e/smoke.spec.ts
```
### Run only Desktop or only Mobile
```bash
npx playwright test --project=chromium-desktop
npx playwright test --project=chromium-mobile
```
### View the HTML Test Report (after a run)
```bash
npm run test:e2e:report
```