Files
integraci-dagger-modules/e2e-test/README.md
T

51 lines
2.0 KiB
Markdown

# e2e-test (Dagger module)
> **Verified 2026-07-16**: dagger v0.21.7 `develop` + `go build` + `dagger
> functions` pass. Generated code (`dagger.gen.go`, `internal/`) is
> gitignored; run `dagger develop` to regenerate.
Runs web end-to-end tests (Playwright or Cypress) against a target
`baseURL`, uploads the report artifact, and POSTs results to the IntegraCI
API. Mirrors the structure and idioms of the `security-scan` module.
## Functions
### `run`
| Param | Required | Default | Description |
| ------------ | -------- | -------------------- | --------------------------------------------- |
| `source` | yes | — | Source directory containing the e2e suite |
| `base-url` | yes | — | Base URL the tests run against |
| `tool` | no | `playwright` | Test runner: `playwright` or `cypress` |
| `report-path`| no | `playwright-report` | Report artifact path inside the source |
| `api-url` | no | — | IntegraCI API URL for posting results |
| `token` | no | — | JWT token for API authentication |
| `service-id` | no | — | Service ID to link test results |
Results are POSTed to the API only when `api-url`, `token`, and
`service-id` are all supplied.
## Usage
```bash
# Playwright (default)
dagger call run --source . --base-url https://staging.example.com --tool playwright
# Cypress, with result posting
dagger call run \
--source . \
--base-url https://staging.example.com \
--tool cypress \
--api-url http://localhost:8000 \
--token "$TOKEN" \
--service-id "$SVC_ID"
```
## Before you trust this
```bash
dagger develop # generate the Dagger Go SDK bindings
dagger functions # confirm `run` is registered with the expected params
dagger call run --source . --base-url https://example.com # smoke test
```