Skip to content

For developers

Allgreen is a layer over Playwright Test, pinned to version 1.65.1. Plans are plain files; a run is playwright test; the export is a standard Playwright project.

Allgreen Playwright
Project playwright.config.ts, one project per browser and device
Plan one test(…)
Step one test.step, named with its sentence
Element a locator: role and name first, then label, text, test id
Check an expect assertion
Look check toHaveScreenshot
Run playwright test on the user’s computer
Phone or tablet an emulated device
Secret an environment variable, ALLGREEN_<NAME>
Sign-in plan a setup project the others depend on, saving storageState

A plan is a JSON file in allgreen/plans/, readable in a Git diff:

{
"version": 1,
"name": "Add a product to the cart",
"steps": [
{ "action": "goto", "path": "/" },
{ "action": "click", "target": { "by": "role", "role": "link", "name": "Shop" } },
{
"action": "click",
"target": {
"by": "role", "role": "button", "name": "Add to cart",
"within": { "by": "role", "role": "region", "name": "Product B" }
}
},
{ "action": "expectVisible", "target": { "by": "text", "text": "1 item", "exact": true } }
]
}

The export writes it as:

import { test, expect } from "@playwright/test"
test("Add a product to the cart", async ({ page }) => {
await test.step("[0] Go to /", async () => {
await page.goto("/")
}, { box: true })
await test.step("[1] Click the \"Shop\" link", async () => {
await page.getByRole("link", { name: "Shop" }).click()
}, { box: true })
await test.step("[2] Click the \"Add to cart\" button in the \"Product B\" region", async () => {
await page.getByRole("region", { name: "Product B" }).getByRole("button", { name: "Add to cart" }).click()
}, { box: true })
await test.step("[3] Verify that \"1 item\" is visible", async () => {
await expect(page.getByText("1 item", { exact: true })).toBeVisible()
}, { box: true })
})
  • The plans are the source. Keep the project folder (with allgreen/) in Git. Non-developers edit plans in Allgreen; changes to exported files do not come back.
  • In CI, two ways:
    • Export and run the exported project with npx playwright test, regenerating it when plans change. You get every Playwright reporter (JUnit, HTML…). See Export for continuous integration.
    • Or run the plans directly with npx allgreen run: it exits 1 if a plan failed. Before it, npx allgreen install-browsers (and npx playwright install-deps on Linux). Secrets come from allgreen/secrets.local.json, which the pipeline writes from its own secrets, for example { "PASSWORD": "…" }. See the command line.
  • Another environment: the site address is written in the project: baseUrl in allgreen/project.json (Site address in the app), baseURL in the exported playwright.config.ts. To test another environment, change it there, for example in the pipeline before the run.
In Allgreen In Playwright
New tries after a failure retries
Patience actionTimeout and the expect timeout
Stop after this many failures maxFailures
Repeat it repeatEach
Watch it in a browser window headless off

Plans run in parallel, with Playwright’s default number of workers (half the CPU cores). For CI services, see Playwright’s guide to continuous integration.

No plan inside another plan, no data-driven runs, one signed-in user per run, no network mocking or API calls yet. The full list: Playwright coverage.