Welcome to Symphony — the human-friendly, YAML-based E2E testing framework for the web. Symphony lets you automate browser workflows in a way that feels natural, readable, and fast to write. This guide will help you get started, understand the YAML syntax, and master all available commands.
- Bun version 1.3.0+
- Node.js (for npm install, if not using Bun)
- Playwright browsers (installed automatically by setup script)
npm install -g @kriptonian/symphonyAfter installing, run the setup script to install Playwright browsers and patch dependencies:
curl -sL https://raw.githubusercontent.com/kriptonian1/symphony/refs/heads/develop/scripts/setup.sh | bashsymphony --versionCreate a file called my-workflow.yml:
name: My First Test
url: https://example.com/
colorMode: dark
flow:
- input:
selector: 'label:Username'
value: 'testuser'
- input:
selector: 'label:Password'
value: 'secret'
- clickOn: Login
- waitFor:
duration: 2000
- scroll:
direction: down
- keyboard:
key: EnterRun your workflow:
symphony --file my-workflow.ymlSymphony provides a simple CLI interface:
symphony --file <path-to-yaml> [options]| Option | Alias | Description | Default |
|---|---|---|---|
--file <path> |
-f |
(Required) Path to the workflow YAML file | |
--headless / --hl |
Run browser in headless mode | false |
|
--browser-engine <engine> |
--be |
Browser engine: chromium, webkit, or firefox |
chromium |
--version |
Show Symphony version | ||
--help |
Show CLI help |
Example:
symphony --file flow-example/google.yml --headless --browser-engine firefoxA Symphony workflow YAML consists of:
name: Name of the workflow (string)url: Target website URL (string, must be a valid URL)colorMode: (optional)"light"or"dark"(default:"light")flow: List of steps (actions) to perform
Enter text into an input field.
- input:
selector: <selector>
value: <text>Selector strategies:
label:<label text>— by visible label or aria-labeltestID:<test id>— bydata-testidattributeplaceholder:<placeholder text>— by placeholderrole:<role> name="<name>"— by ARIA role and accessible name- CSS selector — e.g.,
#username,.form-input,input[name="email"]
Example:
- input:
selector: 'label:Email'
value: 'user@example.com'Click an element by visible text or CSS selector.
- clickOn: <text>or
- clickOn:
selector: <css selector>Examples:
- clickOn: "Login"
- clickOn:
selector: "#submit-btn"Pause execution for a specified duration (milliseconds).
- waitFor:
duration: 2000Simulate key presses or shortcuts.
- keyboard:
key: <key or combination>Supported keys:
- Single keys:
Enter,Escape,KeyA,ArrowUp, etc. - Combinations:
Control+KeyA,Shift+Alt+KeyS,ControlOrMeta+KeyC
Examples:
- keyboard:
key: Enter
- keyboard:
key: Control+KeyAScroll the page by direction or to a position.
By direction:
- scroll:
direction: down # or "up"
speed: 100 # (optional, pixels/sec, default: 300)By position:
- scroll:
position:
x: 0
y: 500name: Demo Workflow
url: https://myapp.com/
colorMode: light
flow:
- input:
selector: 'label:Username'
value: 'alice'
- input:
selector: 'label:Password'
value: 'wonderland'
- clickOn: "Sign In"
- waitFor:
duration: 1500
- scroll:
direction: down
speed: 200
- keyboard:
key: Control+KeyK- Use semantic selectors (
label:,testID:,placeholder:,role:) for robust tests. - Use
waitForafter actions that trigger navigation or animations. - Use
colorModeto ensure consistent UI appearance. - Use
--headlessfor CI/CD environments.
Q: Can I use Playwright selectors?
A: Yes! All CSS selectors supported by Playwright are valid.
Q: How do I debug my workflow?
A: Omit --headless to see the browser UI.
Q: How do I add new actions?
A: See the contributing guide (coming soon).
For a better developer experience—such as autocompletion, in-line documentation, and validation while writing your Symphony YAML files—add the following line at the very top of your YAML test file:
# yaml-language-server: $schema=https://raw.githubusercontent.com/kriptonian1/symphony/refs/heads/main/schemas/json/symphony.jsonThis enables your editor to provide smart suggestions and documentation for all Symphony actions and fields.
Recommended:
- Install the YAML extension by Red Hat in VS Code for full LSP support and schema-based autocompletion.
Happy testing with Symphony!
For more, visit Symphony on GitHub