Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/effect-e2e-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Add it as a devDependency. It is distributed as a workspace tarball of the [syst

`effect-e2e init --dir <suite> --engine web --gateway openrouter` scaffolds a suite: `e2e.config.ts`, `vitest.config.ts`, `runner.ts`, `global-setup.ts`, a deterministic example and an agent example under `tests/`, a `test:e2e` script and a `.e2e/` ignore entry. It asks for any choice not given as a flag, refuses to replace an existing file without `--force`, and installs the suite's dependencies unless `--no-install` is given.

The example tests `init` writes are titled in the `Should_<Behaviour>_When_<Condition>` form that `@systemfsoftware/oxlint-config-recommended` requires. `init` writes no lint configuration, so a suite linted with that preset declares the end-to-end role in its lint config: `settings: { '@systemfsoftware/oxlint-plugin-test-discipline': { role: 'e2e' } }`.

`effect-e2e run --dir <suite> [files...]` runs the suite under Vitest in the same process and prints one report: the one the run's global setup merged into the output directory (`.e2e/` unless the config or `--output` moves it); without `--dir` it uses the nearest directory holding `e2e.config.ts`. `--reporter` picks `list` (the default), `json`, `junit` (writes `junit.xml`) or `markdown` (writes `summary.md`). The process exits with the report's code: 0 passed, 1 failed, 3 blocked, 4 error, 130 interrupted, and 2 when nothing reached a report: a config the runner refuses, a missing suite root, conflicting flags, a `vitest.config.ts` without the effect-e2e global setup, or a Vitest load error. A refused config never reads an older report.

| Flag | Effect |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const exampleAgentTemplate = (): string =>

import { agentSkip } from '../e2e.config.ts'

test('a visitor reaches the top of the home page', { skip: agentSkip }, async ({ app, agent }) => {
test('Should_ReachTheTopOfThePage_When_TheAgentScrolls', { skip: agentSkip }, async ({ app, agent }) => {
await app.open('/')
await agent.act('scroll to the top of the page')
await agent.assert('the page shows a heading')
Expand Down
2 changes: 1 addition & 1 deletion packages/effect-e2e-cli/src/templates/example.template.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const exampleTemplate = (): string =>
`import { expect, test } from '@systemfsoftware/effect-e2e/runner'

test('the home page shows a heading', async ({ app, screen }) => {
test('Should_ShowAHeading_When_TheHomePageOpens', async ({ app, screen }) => {
await app.open('/')
await expect(screen.getByRole('heading')).toBeVisible()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { servedHeadingSite } from './__fixtures__/heading-site-server.js'

const Feature = makeFeature({ it })

const DETERMINISTIC = 'the home page shows a heading'
const AGENT = 'a visitor reaches the top of the home page'
const DETERMINISTIC = 'Should_ShowAHeading_When_TheHomePageOpens'
const AGENT = 'Should_ReachTheTopOfThePage_When_TheAgentScrolls'
const NEVER_HOLDS = 'a sum that never holds'

const NEVER_HOLDING_TEST = `import { expect, test } from '@systemfsoftware/effect-e2e/runner'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { servedHeadingSite } from './__fixtures__/heading-site-server.js'

const Feature = makeFeature({ it })

const DETERMINISTIC = 'the home page shows a heading'
const AGENT = 'a visitor reaches the top of the home page'
const DETERMINISTIC = 'Should_ShowAHeading_When_TheHomePageOpens'
const AGENT = 'Should_ReachTheTopOfThePage_When_TheAgentScrolls'

const NOTHING_LISTENS = 'http://127.0.0.1:9'

Expand Down
2 changes: 1 addition & 1 deletion packages/effect-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default defineConfig({
```ts
import { expect, test } from '@systemfsoftware/effect-e2e/runner'

test('the home page shows a heading', async ({ app, screen }) => {
test('Should_ShowAHeading_When_TheHomePageOpens', async ({ app, screen }) => {
await app.open('/')
await expect(screen.getByRole('heading')).toBeVisible()
})
Expand Down
Loading