Test Execution
POM Export
Export any suite as a structured Playwright project with Page Object Model architecture. Drop into your repo and run.
Playwright POM Export
Pro and above can export any test suite as a fully-structured Playwright project with Page Object Model architecture — not just a single .spec.ts file. The result is a runnable npm project you can drop into your repo, version with git, and run with npx playwright test.
What's in the export
A ZIP containing:
your-project/
├── playwright.config.ts # multi-browser config
├── package.json # dependencies, scripts
├── tsconfig.json
├── .gitignore
├── README.md # how to run
├── tests/
│ ├── checkout.spec.ts # one spec per suite
│ ├── login.spec.ts
│ └── ...
├── pages/ # page object classes
│ ├── CheckoutPage.ts
│ ├── LoginPage.ts
│ └── ...
├── fixtures/
│ ├── test-data.ts # token references
│ └── ...
└── helpers/
├── api-client.ts # for api-request steps
└── ...
Why POM export over single specs
| Single spec | POM project |
|---|---|
| Quick copy-paste check. | Full project you can keep, edit, version-control. |
| Locators inline in test bodies. | Locators centralized in page classes. |
| Hard to maintain when locators drift. | Update one page class, all tests using it benefit. |
| No build config. | playwright.config.ts ready for CI. |
| No package.json. | Depends on Playwright; install with npm. |
How to export
Single suite
- Open the suite.
- Click Export → Playwright POM project.
- Download the ZIP.
Whole project (all suites)
- Open the project, go to Project Config.
- Click Export Tests → Playwright POM project.
- Download the ZIP.
The full-project export has one spec per suite and shared page objects extracted across all suites — giving you the cleanest structure to maintain by hand.
Running the exported project
unzip your-project.zip
cd your-project
npm install
npx playwright install # one-time, downloads browser binaries
npx playwright test # runs all specs on Chromium
# Or specific browser:
npx playwright test --project=firefox
npx playwright test --project=webkit
# Or specific spec:
npx playwright test tests/checkout.spec.ts
The exported project uses Playwright's stock test runner — no AegisRunner dependency once it leaves us.
What's faithfully exported
- All UI steps (navigate, click, fill, wait, assert).
- All API steps as Playwright's
requestfixture calls. - Token references — exported as environment variable substitutions (
process.env.LOGIN_USER). - Multi-browser config in
playwright.config.ts. - Visual regression assertions (Playwright's
toHaveScreenshot). - Custom waits and timeouts.
What's not exported
- Auto-heal. Once outside AegisRunner, locator drift is yours to handle.
- AI triage. Failures are bare Playwright failures.
- Notifications. Hook up your own (Playwright reporters or CI integrations).
- Visual baselines. Exported tests need to capture their own baselines on first local run.
- Token values. Tokens are exported as references; you provide values via environment variables locally.
Configuring tokens locally
The export creates a .env.example:
LOGIN_USER=
LOGIN_PASSWORD=
API_KEY=
STRIPE_TEST_CARD=4242424242424242
Copy to .env and fill in. Playwright config loads them automatically via dotenv.
Updating the export when AegisRunner generates new tests
Re-export and replace the affected files. Page objects are stable across re-exports for the same locators, so your manual edits to page classes survive (we diff carefully). Spec files are regenerated.
Pro tip: keep AegisRunner as the source of truth for generated tests, your repo as the runnable form. Don't hand-edit specs in the exported repo if you're going to keep regenerating — the changes will be lost.
Use cases
Migrate to in-house test maintenance
You've used AegisRunner to bootstrap a test suite. Now you want to own it directly. Export, drop into your repo, run from your CI. AegisRunner becomes optional from there.
Compliance / audit needs
Some teams need test code in their own version control for compliance. Export gives you that.
Hybrid: AegisRunner for some, in-house for others
Run UI regression in AegisRunner (with auto-heal) but export critical paths to your repo for tighter control.
Common questions
Can I export and re-import?
Not yet — export is one-way. If you need round-trip editing, hand-edit in AegisRunner directly.
What's the format of the exported POM classes?
Standard Playwright fixture pattern: a class with locators as properties and methods for actions. Each spec uses fixtures to inject the page objects. Compatible with Playwright's official examples.
Will the exported tests pass on first run?
If your token environment is set up correctly, usually yes. Visual regression tests need to capture baselines on first run (--update-snapshots).
Do API steps in exported tests need a separate setup?
No — they use Playwright's built-in request fixture. Auth tokens come from your .env.