Covers auth, config, run, and CLI framework scenarios against a live
staging server using vitest + real difyctl binary.
Suite layout:
test/e2e/
├── helpers/
│ ├── cli.ts — run(), withAuthFixture(), mintFreshToken()
│ ├── assert.ts — assertExitCode, assertJson, assertErrorEnvelope
│ ├── cleanup-registry.ts — staging data teardown
│ └── retry.ts — withRetry() for flaky network assertions
├── setup/
│ ├── global-setup.ts — health-check, disposable token mint
│ └── global-teardown.ts — conversation cleanup
└── suites/
├── auth/ — status, use, whoami, devices, logout
├── config/ — path, get/set/unset/view, env override
└── run/ — basic, streaming, conversation, file, HITL
Key design decisions:
- Each test uses an isolated temp configDir via withAuthFixture()
- Logout and devices-revoke tests run last to avoid invalidating
the shared E.token used by all other suites
- mintFreshToken() mints a disposable dfoa_ token on demand via the
device flow API so revoke tests never touch the primary session
- Global retry is 0; flaky network calls use withRetry() locally
- test:e2e:smoke script filters to [P0] cases via testNamePattern
package.json: add test:e2e / test:e2e:smoke / test:e2e:local scripts
.gitignore: exclude .env.e2e, oclif.manifest.json, tmp/
.env.e2e.example: credential template for local setup