Init
The spana init command generates a starter config file and example flow through an interactive wizard.
spana initOptions
Section titled “Options”| Flag | Description |
|---|---|
--force | Overwrite existing spana.config.ts if present |
What it does
Section titled “What it does”The wizard asks:
- Which platforms to test — web (Playwright), Android (UiAutomator2), iOS (WebDriverAgent)
- App details per platform:
- Web: app URL (default
http://localhost:3000) - Android: package name (default
com.example.myapp) - iOS: bundle ID (default
com.example.myapp)
- Web: app URL (default
Then it creates:
| File | Description |
|---|---|
spana.config.ts | Config file with your platform and app settings |
flows/example.flow.ts | Starter flow with a smoke test you can customize |
Generated config
Section titled “Generated config”import { defineConfig } from "spana-test";
export default defineConfig({ apps: { web: { url: "http://localhost:3000" }, android: { packageName: "com.example.myapp" }, }, platforms: ["web", "android"], flowDir: "./flows", reporters: ["console"], defaults: { waitTimeout: 5_000, },});Generated flow
Section titled “Generated flow”import { flow } from "spana-test";
export default flow( "Example - app loads successfully", { tags: ["smoke"], platforms: ["web", "android"] }, async ({ app, expect }) => { await expect({ text: "Hello" }).toBeVisible(); },);Next steps
Section titled “Next steps”After running spana init:
- Install spana:
npm install -D spana-test - Add
spana-outputto your.gitignore - Edit
flows/example.flow.tswith selectors from your app - Discover selectors:
spana selectors - Run tests:
spana test