---
suite: webtest-ai-demo-reuse
app: webtest-ai-demo-console
baseUrl: http://127.0.0.1:4010
tags: [demo, local, webtest-ai, reuse]
auth:
  usernameEnv: WEBTEST_AI_DEMO_USERNAME
  passwordEnv: WEBTEST_AI_DEMO_PASSWORD
  mfaCodeEnv: WEBTEST_AI_DEMO_MFA_CODE
  validationPath: /api/session
browsers: [chromium]
---

# Same-host session is revalidated across specs

tags: [auth, same-host, cross-spec, serial]
priority: high
owner: qe-foundation
auth:
  mode: reuse
  profile: webtest-ai-same-host
  loginMode: same-host
  saveStorageState: true

## Goal

Verify the same-host session created by the main demo spec can be reused and revalidated from another spec file.

## Steps

1. Open "/"
2. Assert text "Welcome, Demo Operator"
3. Assert text "Session valid"
4. Assert text "Enterprise checkout matrix"

## Expected

- The profile is loaded from `playwright/.auth`.
- Validation runs before reuse.
- The authenticated dashboard is available across spec files.

---

# IDP session is revalidated across specs

tags: [auth, idp, cross-spec, serial]
priority: high
owner: qe-foundation
auth:
  mode: reuse
  profile: webtest-ai-idp
  provider: idp
  loginMode: idp
  saveStorageState: true

## Goal

Verify the IDP session created by the main demo spec can be reused and revalidated from another spec file.

## Steps

1. Open "/"
2. Assert text "Welcome, Demo Operator"
3. Click role "tab" named "Audit"
4. Assert text "IDP login verified"

## Expected

- The IDP-backed app session is loaded from storage state.
- Validation passes before the test context is created.
- Cross-spec reuse does not replay the IDP login unless validation fails.
