# Playwright Test Pack - Commercial Lite Scenarios

This repository does not currently include a `package.json` or Playwright dependency. Do not add Playwright to production dependencies. If browser automation is approved, add it as a dev-only test harness or run it from a separate QA workspace.

## Suggested Setup

```powershell
npm init -y
npm install --save-dev @playwright/test
npx playwright install chromium
```

Use `BASE_URL=http://localhost/zavvion-events/public` locally, and the deployed HTTPS base URL on staging.

## Smoke Specs To Implement

### Public Discovery

- Open `/home.html`, `/events.html`.
- Assert no console errors.
- Filter search/category/seating/status.
- Open at least four demo events.
- Verify cards do not overflow at `320px`, `360px`, `768px`, `1440px`.

### Public Event Booking

- Open `/event.html?slug=ui-workflow-event-292430`.
- Verify `Booking` and `Seat-map` controls exist.
- Verify `Reserved seats` appears before `Non reserved seats`.
- Verify each reserved section tab switches visible seat grid.
- Select three seats in different rows.
- Verify basket labels remain one-line/readable.
- Assign ticket types to selected seats.
- Add non-reserved ticket quantity.
- Continue to checkout.
- Verify draft was created and timer starts at no more than 15 minutes.

### Checkout Safety

- Attempt to POST public checkout draft with cash/manual/external-card payment method.
- Expect server rejection.
- Tamper with total/currency in request.
- Expect server-calculated value or rejection.
- Refresh checkout page and verify draft/token handling.

### Organiser Workflow

- Login as organiser.
- Open organiser console.
- Create venue.
- Create seat map with two reserved sections and one non-reserved section.
- Upload/replace PDF floor plan for that exact seat map.
- Create event with a future date.
- Select the exact seat map.
- Save draft and reopen edit.
- Verify venue/seat-map fields persist.
- Allocate ticket types with price/quantity/max order in event editor.
- Remove one event allocation.
- Preview public event and verify only allocated tickets appear.

### Platform Organiser Boundaries

- Login as platform organiser.
- Verify organiser console opens.
- Attempt platform admin API endpoints.
- Expect 401/403.
- Verify platform admin menus are not visible.

### Platform Admin Workflow

- Login as platform admin.
- Open organiser applications.
- Open fees.
- Create non-conflicting fee rule.
- Attempt conflicting active global country fee rule.
- Expect validation rejection.
- Edit/deactivate/delete a fee rule where supported.
- Open health/deployment readiness.

### Role Negative Tests

- Public cannot access organiser/admin APIs.
- Customer cannot access organiser/admin APIs.
- Organiser cannot access admin APIs.
- Platform organiser cannot access admin APIs.
- Scanner/cashier/event-manager routes are hidden or deferred in `ticket-selling-v1`.

### Responsive Matrix

Run public event, checkout, account, organiser, admin at:

- `320x740`
- `360x740`
- `375x812`
- `390x844`
- `414x896`
- `430x932`
- `768x1024`
- `820x1180`
- `1024x768`
- `1280x800`
- `1440x900`
- `1920x1080`

Assertions:

- No horizontal body overflow except intentional seat-map internal scrolling/zoom.
- Buttons are visible and tappable.
- Basket/order panels do not cover primary actions.
- No text overlaps inside cards/buttons/baskets.
- Modals/drawers close by Escape and restore focus.

## Pass/Fail Rules

Fail the run if:

- Any paid ticket issues without trusted payment confirmation.
- Cash/external terminal appears in public checkout.
- Any role can access another role’s admin/organiser API.
- Event date before current date can be saved.
- Public event shows tickets not allocated to that event.
- Selected event uses a different seat map from organiser configuration.
- Checkout timer exceeds 15 minutes.
- Mobile layouts hide primary actions or clip critical labels.
