User Flows, Navigation & SPA Behavior
Run 30 test cases across 4 parallel agents covering authentication, registration, SPA navigation, and data flows.
Setup
URL="${ARGUMENTS:-http://localhost:3000}"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
OUTDIR="test-results/test-flows/$TIMESTAMP"
mkdir -p "$OUTDIR/screenshots" "$OUTDIR/snapshots" "$OUTDIR/traces" "$OUTDIR/videos"
Credentials
Credentials must come from arguments or environment variables:
# From $ARGUMENTS: /test-flows https://app.com user@example.com password123
TEST_URL=$(echo "$ARGUMENTS" | awk '{print $1}')
TEST_USER_ARG=$(echo "$ARGUMENTS" | awk '{print $2}')
TEST_PASS_ARG=$(echo "$ARGUMENTS" | awk '{print $3}')
URL="${TEST_URL:-http://localhost:3000}"
USER="${TEST_USER_ARG:-$TEST_USER}"
PASS="${TEST_PASS_ARG:-$TEST_PASS}"
If no credentials provided, auth-related tests should be skipped (not failed) with a note in the report.
Parallel Execution — 4 Subagents
Agent 1: Auth (-s=flows-auth, --persistent)
Tests authentication flows. Uses persistent profile to maintain session state.
playwright-cli -s=flows-auth open "$URL" --persistent
playwright-cli -s=flows-auth tracing-start
playwright-cli -s=flows-auth video-start
Test Cases:
| TC |
Test |
How to Check |
| TC-FL1 |
Login→dashboard→settings→logout full chain |
Fill login form, submit, navigate to dashboard, then settings, then logout. Verify each page loads correctly |
| TC-FL2 |
Session persistence (navigate away/back) |
After login, navigate to external URL, come back, verify still logged in |
| TC-FL3 |
"Remember me" functionality |
If checkbox exists: login with "remember me", close browser, reopen, verify still logged in |
| TC-FL4 |
Social login buttons present/functional |
Check for OAuth buttons (Google, GitHub, Facebook), verify they link to valid OAuth endpoints |
| TC-FL5 |
2FA/MFA flow (if present) |
If 2FA UI exists: verify the flow is navigable (OTP input, verification page) |
| TC-FL6 |
Account lockout after failed attempts |
Attempt 5+ failed logins with wrong password, check for lockout or rate-limit message |
playwright-cli -s=flows-auth video-stop "$OUTDIR/videos/auth-flow.webm"
playwright-cli -s=flows-auth state-save "$OUTDIR/auth-state.json"
playwright-cli -s=flows-auth tracing-stop
playwright-cli -s=flows-auth close
Agent 2: Register (-s=flows-register)
Tests registration and account management flows.
playwright-cli -s=flows-register open "$URL"
playwright-cli -s=flows-register tracing-start
Test Cases:
| TC |
Test |
How to Check |
| TC-FL7 |
Registration end-to-end |
Navigate to registration page, fill all fields, submit, verify success |
| TC-FL8 |
Password reset flow |
Navigate to "forgot password", enter email, verify confirmation page/message |
| TC-FL9 |
Email verification flow |
If email verification exists: check for verification prompt after registration |
| TC-FL10 |
Profile edit + save |
If profile page exists: edit a field, save, reload, verify change persisted |
| TC-FL11 |
Account deletion flow |
If account deletion exists: navigate to it, verify confirmation dialog |
| TC-FL12 |
Password strength indicator |
On registration/password change: type passwords of varying strength, verify indicator updates |
playwright-cli -s=flows-register tracing-stop
playwright-cli -s=flows-register close
Agent 3: Navigation (-s=flows-navigation)
Tests SPA navigation and browser behavior.
playwright-cli -s=flows-navigation open "$URL"
playwright-cli -s=flows-navigation tracing-start
Test Cases:
| TC |
Test |
How to Check |
| TC-FL13 |
Browser back button works in SPA |
Navigate 2-3 pages, go-back, verify previous page content loads correctly |
| TC-FL14 |
Browser forward button works |
go-back then go-forward, verify correct page loads |
| TC-FL15 |
Deep linking — direct URL to nested page |
Open a deep URL directly (e.g., $URL/settings/profile), verify it loads correctly |
| TC-FL16 |
404 page for invalid routes |
Navigate to $URL/nonexistent-page-xyz, verify 404 page with navigation |
| TC-FL17 |
Breadcrumb navigation accuracy |
If breadcrumbs exist: click each breadcrumb link, verify correct page |
| TC-FL18 |
Scroll position restored on back |
Scroll down on page, navigate away, go-back, check scroll position restored |
| TC-FL19 |
Anchor links scroll to correct position |
Find # links, click them, verify page scrolls to target element |
| TC-FL20 |
Hash changes update URL |
Click anchor link, verify URL hash updates in browser |
| TC-FL21 |
Refresh preserves state |
Fill form or apply filter, reload, verify state preserved |
| TC-FL22 |
Protected routes redirect to login |
If auth exists: navigate to protected route without login, verify redirect to login page |
playwright-cli -s=flows-navigation tracing-stop
playwright-cli -s=flows-navigation close
Agent 4: Data (-s=flows-data)
Tests data flows — pagination, search, CRUD operations.
playwright-cli -s=flows-data open "$URL"
playwright-cli -s=flows-data tracing-start
Test Cases:
| TC |
Test |
How to Check |
| TC-FL23 |
Pagination — all pages load, no duplicates |
If pagination exists: navigate pages, collect items, verify no duplicates across pages |
| TC-FL24 |
Infinite scroll — items append, no gaps |
If infinite scroll exists: scroll down, verify new items append without gaps or duplicates |
| TC-FL25 |
Search — results display, empty state shown |
If search exists: search for known term (verify results), search for gibberish (verify empty state) |
| TC-FL26 |
Search — debounce works |
If search exists: type rapidly, check network requests aren't fired per keystroke (use network) |
| TC-FL27 |
Sort/filter — changes reflected |
If sort/filter exists: apply sort, verify order changes. Apply filter, verify items filtered |
| TC-FL28 |
CRUD — create/read/update/delete cycle |
If CRUD exists: create item, verify appears. Edit item, verify updated. Delete item, verify removed |
| TC-FL29 |
Optimistic update — UI updates before server |
If CRUD exists: run-code to intercept mutation request (add delay), verify UI updates immediately |
| TC-FL30 |
Stale data — refresh shows updated data |
Load page, run-code to modify data via API, reload, verify updated data shown |
playwright-cli -s=flows-data tracing-stop
playwright-cli -s=flows-data close
Report Generation
After all 4 agents complete, merge results into $OUTDIR/report.md.
Note skipped tests prominently (especially auth tests when no credentials provided).
Group results:
- Authentication (TC-FL1 through TC-FL6)
- Registration (TC-FL7 through TC-FL12)
- Navigation (TC-FL13 through TC-FL22)
- Data Flows (TC-FL23 through TC-FL30)
Cleanup
playwright-cli -s=flows-auth close 2>/dev/null
playwright-cli -s=flows-register close 2>/dev/null
playwright-cli -s=flows-navigation close 2>/dev/null
playwright-cli -s=flows-data close 2>/dev/null
1---2name: test-flows-23description: Test user flows, authentication, navigation, and SPA behavior. Use when user wants to test login flows, registration, browser history, pagination, search, CRUD operations, or routing.4---56# User Flows, Navigation & SPA Behavior78Run 30 test cases across 4 parallel agents covering authentication, registration, SPA navigation, and data flows.910## Setup1112```bash13URL="${ARGUMENTS:-http://localhost:3000}"14TIMESTAMP=$(date +%Y%m%d-%H%M%S)15OUTDIR="test-results/test-flows/$TIMESTAMP"16mkdir -p "$OUTDIR/screenshots" "$OUTDIR/snapshots" "$OUTDIR/traces" "$OUTDIR/videos"17```1819## Credentials2021Credentials must come from arguments or environment variables:22```bash23# From $ARGUMENTS: /test-flows https://app.com user@example.com password12324TEST_URL=$(echo "$ARGUMENTS" | awk '{print $1}')25TEST_USER_ARG=$(echo "$ARGUMENTS" | awk '{print $2}')26TEST_PASS_ARG=$(echo "$ARGUMENTS" | awk '{print $3}')2728URL="${TEST_URL:-http://localhost:3000}"29USER="${TEST_USER_ARG:-$TEST_USER}"30PASS="${TEST_PASS_ARG:-$TEST_PASS}"31```3233If no credentials provided, auth-related tests should be **skipped** (not failed) with a note in the report.3435## Parallel Execution — 4 Subagents3637### Agent 1: Auth (`-s=flows-auth`, `--persistent`)3839Tests authentication flows. Uses persistent profile to maintain session state.4041```bash42playwright-cli -s=flows-auth open "$URL" --persistent43playwright-cli -s=flows-auth tracing-start44playwright-cli -s=flows-auth video-start45```4647**Test Cases:**4849| TC | Test | How to Check |50|----|------|-------------|51| TC-FL1 | Login→dashboard→settings→logout full chain | Fill login form, submit, navigate to dashboard, then settings, then logout. Verify each page loads correctly |52| TC-FL2 | Session persistence (navigate away/back) | After login, navigate to external URL, come back, verify still logged in |53| TC-FL3 | "Remember me" functionality | If checkbox exists: login with "remember me", close browser, reopen, verify still logged in |54| TC-FL4 | Social login buttons present/functional | Check for OAuth buttons (Google, GitHub, Facebook), verify they link to valid OAuth endpoints |55| TC-FL5 | 2FA/MFA flow (if present) | If 2FA UI exists: verify the flow is navigable (OTP input, verification page) |56| TC-FL6 | Account lockout after failed attempts | Attempt 5+ failed logins with wrong password, check for lockout or rate-limit message |5758```bash59playwright-cli -s=flows-auth video-stop "$OUTDIR/videos/auth-flow.webm"60playwright-cli -s=flows-auth state-save "$OUTDIR/auth-state.json"61playwright-cli -s=flows-auth tracing-stop62playwright-cli -s=flows-auth close63```6465### Agent 2: Register (`-s=flows-register`)6667Tests registration and account management flows.6869```bash70playwright-cli -s=flows-register open "$URL"71playwright-cli -s=flows-register tracing-start72```7374**Test Cases:**7576| TC | Test | How to Check |77|----|------|-------------|78| TC-FL7 | Registration end-to-end | Navigate to registration page, fill all fields, submit, verify success |79| TC-FL8 | Password reset flow | Navigate to "forgot password", enter email, verify confirmation page/message |80| TC-FL9 | Email verification flow | If email verification exists: check for verification prompt after registration |81| TC-FL10 | Profile edit + save | If profile page exists: edit a field, save, reload, verify change persisted |82| TC-FL11 | Account deletion flow | If account deletion exists: navigate to it, verify confirmation dialog |83| TC-FL12 | Password strength indicator | On registration/password change: type passwords of varying strength, verify indicator updates |8485```bash86playwright-cli -s=flows-register tracing-stop87playwright-cli -s=flows-register close88```8990### Agent 3: Navigation (`-s=flows-navigation`)9192Tests SPA navigation and browser behavior.9394```bash95playwright-cli -s=flows-navigation open "$URL"96playwright-cli -s=flows-navigation tracing-start97```9899**Test Cases:**100101| TC | Test | How to Check |102|----|------|-------------|103| TC-FL13 | Browser back button works in SPA | Navigate 2-3 pages, `go-back`, verify previous page content loads correctly |104| TC-FL14 | Browser forward button works | `go-back` then `go-forward`, verify correct page loads |105| TC-FL15 | Deep linking — direct URL to nested page | Open a deep URL directly (e.g., `$URL/settings/profile`), verify it loads correctly |106| TC-FL16 | 404 page for invalid routes | Navigate to `$URL/nonexistent-page-xyz`, verify 404 page with navigation |107| TC-FL17 | Breadcrumb navigation accuracy | If breadcrumbs exist: click each breadcrumb link, verify correct page |108| TC-FL18 | Scroll position restored on back | Scroll down on page, navigate away, `go-back`, check scroll position restored |109| TC-FL19 | Anchor links scroll to correct position | Find `#` links, click them, verify page scrolls to target element |110| TC-FL20 | Hash changes update URL | Click anchor link, verify URL hash updates in browser |111| TC-FL21 | Refresh preserves state | Fill form or apply filter, `reload`, verify state preserved |112| TC-FL22 | Protected routes redirect to login | If auth exists: navigate to protected route without login, verify redirect to login page |113114```bash115playwright-cli -s=flows-navigation tracing-stop116playwright-cli -s=flows-navigation close117```118119### Agent 4: Data (`-s=flows-data`)120121Tests data flows — pagination, search, CRUD operations.122123```bash124playwright-cli -s=flows-data open "$URL"125playwright-cli -s=flows-data tracing-start126```127128**Test Cases:**129130| TC | Test | How to Check |131|----|------|-------------|132| TC-FL23 | Pagination — all pages load, no duplicates | If pagination exists: navigate pages, collect items, verify no duplicates across pages |133| TC-FL24 | Infinite scroll — items append, no gaps | If infinite scroll exists: scroll down, verify new items append without gaps or duplicates |134| TC-FL25 | Search — results display, empty state shown | If search exists: search for known term (verify results), search for gibberish (verify empty state) |135| TC-FL26 | Search — debounce works | If search exists: type rapidly, check network requests aren't fired per keystroke (use `network`) |136| TC-FL27 | Sort/filter — changes reflected | If sort/filter exists: apply sort, verify order changes. Apply filter, verify items filtered |137| TC-FL28 | CRUD — create/read/update/delete cycle | If CRUD exists: create item, verify appears. Edit item, verify updated. Delete item, verify removed |138| TC-FL29 | Optimistic update — UI updates before server | If CRUD exists: `run-code` to intercept mutation request (add delay), verify UI updates immediately |139| TC-FL30 | Stale data — refresh shows updated data | Load page, `run-code` to modify data via API, reload, verify updated data shown |140141```bash142playwright-cli -s=flows-data tracing-stop143playwright-cli -s=flows-data close144```145146## Report Generation147148After all 4 agents complete, merge results into `$OUTDIR/report.md`.149150Note skipped tests prominently (especially auth tests when no credentials provided).151152Group results:1531. Authentication (TC-FL1 through TC-FL6)1542. Registration (TC-FL7 through TC-FL12)1553. Navigation (TC-FL13 through TC-FL22)1564. Data Flows (TC-FL23 through TC-FL30)157158## Cleanup159160```bash161playwright-cli -s=flows-auth close 2>/dev/null162playwright-cli -s=flows-register close 2>/dev/null163playwright-cli -s=flows-navigation close 2>/dev/null164playwright-cli -s=flows-data close 2>/dev/null165```