# Features — playwright_tests

Evidence date: 2026-10-06. Inspected revision: `main` at `41f992c`.

"Feature" here means a test capability in this repository, not a feature of SAWIS, ShopFlow, or IPW themselves. Status is against git, not against a live test run performed for this document.

## Current features

### Repository shape

| Feature | Status | Evidence |
|---|---|---|
| One directory per target hostname | Current | Top-level folders at `41f992c` |
| Independent `package.json` per real suite | Current | BI, ShopFlow, IPW. No root package |
| Root `.gitignore` for `node_modules`, `.env`, `auth.json`, root-only Playwright output | Current | `.gitignore`. Nested BI reports are still tracked. See technical documentation |

### SAWIS BI (`bi.sawisonline.co.za/`)

Suite name **sawis-playwright-tests** 1.0.0. Playwright ^1.40.0.

| Feature | Spec | `test()` calls | Status |
|---|---|---|---|
| Homepage load, navigation, metrics, charts, filters, footer, responsive layout, accessibility, console errors | `tests/homepage.spec.ts` | 9 | Current |
| Login modal, validation, reCAPTCHA presence, forgot password, create account, dismiss, keyboard, focus | `tests/login.spec.ts` | 13 | Current |
| Year, month, period, product type, country, package type, cultivar/type filters | `tests/filters.spec.ts` | 16 | Current |
| Overview, Volume, Value, Price Range tabs | `tests/navigation.spec.ts` | 16 | Current |
| Chart display, export, tables, tooltips, loading, error states | `tests/charts.spec.ts` | 18 | Current |
| Load, filter, navigation, memory, latency, mobile timing | `tests/performance.spec.ts` | 14 | Current |
| Shortcut runner (`quick`, `homepage`, `login`, `filters`, `nav`, `charts`, `perf`, `all`) | `run-tests.js` and `package.json` scripts | — | Current |
| Multi-browser projects including Pixel 5 and iPhone 12 | `playwright.config.ts` | — | Current |
| Codegen script aimed at the BI URL | `npm run codegen` | — | Current |
| Committed HTML report and failure media | `playwright-report/`, `test-results/` | 1561 files | Current in git. Whether they should be is **Requires confirmation** |

**Documented** in `NewKnowledgeBase.md` and not re-verified against the site: data described as wine export data from the Department of Agriculture; metric text example `Total Export (l)`; modal login with reCAPTCHA. Treat that file as notes, not as proof of the live data source.

### ShopFlow (`qa.shopflow.io.dedi1534.jnb2.host-h.net/`)

Playwright ^1.56.0. Last behaviour change: `41f992c` (login, logout, authenticator).

| Feature | Location | `test()` calls | Status |
|---|---|---|---|
| Phase project order and serial workers | `playwright.config.ts` | — | Current |
| Login, logout, invalid login, 2FA | `tests/01-authentication/` | 25 | Current. Updated in `41f992c` |
| Product catalog, cart, add to cart, checkout, orders, order history, saved carts, JAB orders | `tests/02-core-commerce/` | 73 | Current. Depends on `auth.json` |
| User list, profile view/edit, role permissions | `tests/03-user-management/` | 40 | Current. Depends on `auth.json` |
| Buyer groups, sellers, seller groups, stores, industries | `tests/04-partner-management/` | 49 | Current. Depends on `auth.json` |
| Price files, upload, applications, pricing rules, catalog admin | `tests/05-price-management/` | 53 | Current. Depends on `auth.json` |
| Seller dashboard, orders, products, analytics, settings | `tests/06-seller-portal/` | 38 | Current. Depends on `auth.json`. README marks this phase **[NEW]** |
| Shared authenticator and blocked-IP detection | `utils/authentication.ts` | — | Current |
| Gmail IMAP 2FA fetch | `utils/email-2fa-fetcher.ts` | — | Current, optional |
| Env loading with fallbacks | `utils/test-config.ts` | — | Current |
| Authenticated fixture and `auth.json` writer | `fixtures/authenticated.fixture.ts`, `helpers/test-helpers.ts` | — | Current |
| Price/date/session assertions | `helpers/assertions.ts` | — | Current |
| Fixture products and orders JSON | `test-data/products.json`, `test-data/orders.json`, `test-data/cleanup-tracker.json` | — | Current |
| Patterns write-up and DataTable click-handler note | `PROJECT_PATTERNS_AND_RULES.md`, `DATATABLE_NAVIGATION_FIX.md` | — | Current as documents. The patterns doc's tagging rules are only partly followed by specs |

Phase npm scripts `test:phase1` … `test:phase6` match the projects. **Current.**

### IPW staging (`staging.ipw.co.za/`)

Suite name **staging-ipw-playwright-tests** 1.0.0. Playwright ^1.40.0.

| Feature | Location | `test()` calls | Status |
|---|---|---|---|
| Login spec with hardcoded Overdrive email | `tests/login.spec.ts` | 9 | Current. README says this area was failing as of the in-repo summary |
| Navigation, Afrikaans switch, logo, breadcrumbs | `tests/navigation.spec.ts` | 9 | Current |
| Authentication spec (separate from `login.spec.ts`) | `tests/authentication.spec.js` | 7 | Current |
| Post-login dashboard, profile, settings, notifications, logout | `tests/post-login-functionality.spec.js` | 8 | Current. Contains `test.skip()` |
| Homepage, forms, search, responsive | `tests/main-functionality.spec.js` | 7 | Current |
| Basic site load / HTML structure | `tests/site-accessibility.spec.js` | 4 | Current. In-repo summary says this suite passed. Count in that summary (20) does not match this file (4) |
| WCAG-style checks (headings, alt, keyboard, ARIA, contrast, labels) | `tests/accessibility.spec.js` | 8 | Current |
| Browser security probes | `tests/security.spec.js` | 9 | Current. In-repo summary says not executed |
| Performance specs | `tests/performance.spec.js` | 7 | Current |
| Selector map | `tests/utils/selectors.ts` | — | Current |
| Second Playwright config with global setup | `playwright.config.js`, `scripts/global-setup.js`, `scripts/global-teardown.js` | — | Present. Not selected by default `npm test` |
| MySQL check, schema, save results | `scripts/check-db.js`, `check-schema.js`, `save-test-results.js` | — | Current as scripts |
| HTML report, PDF report, email report | `scripts/generate-html-report.js`, `generate-pdf-report.js`, `send-email-report.js` | — | Current as scripts. Email body hardcodes an old summary |
| Checked-in HTML and PDF report | `playwright-test-report.html`, `playwright-test-report.pdf` | — | Current in git |
| Result snapshot | `test-summary.json`, `COMPREHENSIVE_TEST_REPORT.md` | — | Historical. Counts disagree with the spec files |

## Completed features

Git history is four commits and does not mark a release. Changelog `[1.0.0]` entries describe the initial BI and IPW content as a completed 1.0.0. Those changelog dates (2024-07-24 and 2024-12-19) predate the commits that added the files (2025-11-18).

ShopFlow arrived in one commit (`15537a0`) and had one follow-up (`41f992c`). Nothing in git is tagged as a release.

## Planned features

Only `staging.ipw.co.za/CHANGELOG.md` `[Unreleased]` lists future work:

- Additional page-specific tests
- Performance testing integration
- Accessibility testing automation
- API endpoint testing
- Database integration tests
- Advanced error scenarios
- Selector, test-data, parallel-execution, reporter, and monitoring improvements

**Conflict.** Performance specs, accessibility specs, and database scripts are already in the tree. API endpoint tests and monitoring integration were not found. Treat the unmatched lines as **Planned**. Treat the lines that already have files as a stale changelog, not as a backlog.

No TODO/FIXME survey was treated as a roadmap. ShopFlow README "legacy" commands are not planned files; they are documentation of files that are absent.

## In development

No branch other than `main`. No commit since 2025-11-24. **Inferred** status: not under active development at inspection time.

The ShopFlow README label **[NEW]** on phase 6 is the author's wording at the time of `15537a0`. Phase 6 is in `main`, not on a feature branch.

## Recently changed

`41f992c` (2025-11-24), ShopFlow only:

- `tests/01-authentication/login.spec.ts`
- `tests/01-authentication/logout.spec.ts`
- `utils/authentication.ts`
- `playwright.config.ts` (one line)
- `package.json` (one line)
- `README.md` (one line)

Commit message: "Fixup login tests". The diff is 204 insertions and 133 deletions. A line-by-line product change beyond "login and logout behaviour was adjusted" was not summarised from the patch. **Requires confirmation** if a reviewer needs the exact assertion changes.

## Deprecated or removed

No spec file is deleted in the four-commit history.

The ShopFlow README still names spec files and npm scripts that were never added in `15537a0` or `41f992c`. They are absent, not removed.

`PROJECT_PATTERNS_AND_RULES.md` says `.env` is not committed. That is true for the ShopFlow directory. It is false for `sawisonline.co.za/.env`.

## Not built

| Item | Evidence |
|---|---|
| Specs for `label.sawis.co.za` | Only `TEST_SPECIFICATION_TEMPLATE.md`. The prompt targets IPW staging, not this host |
| Specs for `qa.d3t8evj08x1w1g.amplifyapp.com` | Template only. Prompt names that URL |
| Specs for `sawisonline.co.za` | Template plus `.env` pointing `BASE_URL` at the BI site. No tests |
| Root runner that executes every suite | No root `package.json` |
| Bitbucket pipeline, Sonar project file, `sonarqube_scan.bat` | Not in any commit. The onboarding scan listed the Sonar file and the bat file |
| ShopFlow Firefox, WebKit, and mobile projects | Commented out in `playwright.config.ts` |
| BI Microsoft Edge and Google Chrome channel projects | Commented out |

## Feature counts used above

`test()` calls were counted with a line pattern on `*.spec.ts` and `*.spec.js` at `41f992c`. Nested `test.skip()` inside a test body was not added as an extra test. Totals: BI 86, ShopFlow 278, IPW 68.
