explorbot 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/explorbot-cli.ts +26 -8
- package/boat/api-tester/src/cli.ts +17 -0
- package/boat/api-tester/src/config.ts +4 -2
- package/boat/doc-collector/bin/doc-collector-cli.ts +2 -0
- package/boat/doc-collector/src/ai/documentarian.ts +61 -31
- package/boat/doc-collector/src/cli.ts +14 -1
- package/boat/doc-collector/src/config.ts +4 -2
- package/boat/prima/bin/prima-cli.ts +0 -0
- package/boat/prima/src/activity-line.ts +33 -0
- package/boat/prima/src/cli.ts +127 -86
- package/boat/prima/src/envelope.ts +102 -52
- package/boat/prima/src/prima.ts +567 -128
- package/boat/prima/src/pw-parser.ts +11 -1
- package/boat/prima/src/pw-registry.ts +4 -5
- package/boat/prima/src/session-log.ts +126 -0
- package/dist/bin/explorbot-cli.js +26 -8
- package/dist/boat/api-tester/bin/apibot-cli.js +2 -0
- package/dist/boat/api-tester/src/cli.js +17 -0
- package/dist/boat/api-tester/src/config.js +4 -2
- package/dist/boat/doc-collector/bin/doc-collector-cli.js +2 -0
- package/dist/boat/doc-collector/src/ai/documentarian.js +44 -19
- package/dist/boat/doc-collector/src/cli.js +14 -1
- package/dist/boat/doc-collector/src/config.js +4 -2
- package/dist/boat/prima/src/activity-line.js +30 -0
- package/dist/boat/prima/src/cli.js +109 -77
- package/dist/boat/prima/src/envelope.js +94 -44
- package/dist/boat/prima/src/prima.js +533 -119
- package/dist/boat/prima/src/pw-parser.js +13 -1
- package/dist/boat/prima/src/pw-registry.js +4 -5
- package/dist/boat/prima/src/session-log.js +108 -0
- package/dist/package.json +3 -2
- package/dist/rules/navigator/verification-actions.md +20 -0
- package/dist/src/action-result.d.ts +7 -0
- package/dist/src/action-result.js +4 -0
- package/dist/src/action.d.ts +2 -0
- package/dist/src/action.js +41 -2
- package/dist/src/ai/captain/web-mode.js +6 -3
- package/dist/src/ai/captain.js +2 -0
- package/dist/src/ai/navigator.d.ts +34 -0
- package/dist/src/ai/navigator.js +237 -181
- package/dist/src/ai/pilot.d.ts +7 -0
- package/dist/src/ai/pilot.js +90 -2
- package/dist/src/ai/provider.d.ts +2 -2
- package/dist/src/ai/provider.js +14 -23
- package/dist/src/ai/rerunner.js +2 -1
- package/dist/src/ai/researcher/cache.d.ts +2 -0
- package/dist/src/ai/researcher/cache.js +10 -2
- package/dist/src/ai/researcher.js +3 -2
- package/dist/src/ai/rules.js +17 -10
- package/dist/src/ai/session-analyst.js +2 -0
- package/dist/src/ai/task-agent.js +4 -1
- package/dist/src/ai/tester.d.ts +6 -3
- package/dist/src/ai/tester.js +50 -46
- package/dist/src/ai/tools.d.ts +14 -0
- package/dist/src/ai/tools.js +117 -37
- package/dist/src/commands/config-command.d.ts +51 -0
- package/dist/src/commands/config-command.js +117 -0
- package/dist/src/commands/index.js +2 -0
- package/dist/src/config.d.ts +9 -1
- package/dist/src/config.js +53 -4
- package/dist/src/execution-controller.d.ts +2 -0
- package/dist/src/execution-controller.js +6 -0
- package/dist/src/explorbot.d.ts +2 -1
- package/dist/src/explorbot.js +7 -2
- package/dist/src/explorer.js +2 -3
- package/dist/src/playwright-recorder.js +30 -0
- package/dist/src/remote.d.ts +55 -0
- package/dist/src/remote.js +235 -0
- package/dist/src/reporter.d.ts +1 -0
- package/dist/src/reporter.js +7 -1
- package/dist/src/state-manager.d.ts +2 -1
- package/dist/src/state-manager.js +3 -1
- package/dist/src/stats.d.ts +1 -0
- package/dist/src/stats.js +1 -0
- package/dist/src/test-plan.d.ts +3 -0
- package/dist/src/test-plan.js +26 -0
- package/dist/src/utils/aria.d.ts +2 -8
- package/dist/src/utils/aria.js +69 -40
- package/dist/src/utils/html.js +1 -0
- package/dist/src/utils/logger.d.ts +7 -1
- package/dist/src/utils/logger.js +32 -0
- package/dist/src/utils/page-readiness.js +18 -1
- package/dist/src/utils/url-matcher.js +3 -0
- package/dist/src/utils/web-element.d.ts +2 -0
- package/dist/src/utils/web-element.js +8 -0
- package/dist/src/utils/web-sandbox.d.ts +1 -1
- package/dist/src/utils/web-sandbox.js +2 -3
- package/docs/api-testing/basics.md +90 -0
- package/docs/api-testing/planning.md +57 -0
- package/docs/api-testing/running-tests.md +55 -0
- package/docs/assets/cloud-report.png +0 -0
- package/docs/assets/html-report.png +0 -0
- package/docs/assets/langfuse-trace.png +0 -0
- package/docs/assets/successful-explore-run.png +0 -0
- package/docs/basics/getting-started.md +140 -0
- package/docs/basics/prerequisites.md +63 -0
- package/docs/basics/providers.md +362 -0
- package/docs/basics/running.md +78 -0
- package/docs/contributing/ai-integration-tests.md +57 -0
- package/docs/contributing/contributing.md +90 -0
- package/docs/contributing/demo-videos.md +36 -0
- package/docs/contributing/npm-package.md +138 -0
- package/docs/contributing/observability.md +227 -0
- package/docs/contributing/regression-tests.md +103 -0
- package/docs/contributing/testing.md +95 -0
- package/docs/doc-collection/basics.md +128 -0
- package/docs/doc-collection/crawling.md +67 -0
- package/docs/doc-collection/interactive-mode.md +99 -0
- package/docs/index.json +87 -0
- package/docs/reference/commands.md +997 -0
- package/docs/reference/configuration.md +569 -0
- package/docs/reference/scripting.md +303 -0
- package/docs/reference/websocket.md +50 -0
- package/docs/superpowers/plans/2026-08-01-actor-boat.md +925 -0
- package/docs/superpowers/plans/2026-08-01-prima-boat.md +1120 -0
- package/docs/superpowers/reviews/2026-08-06-prima-vs-playwright-cli.md +268 -0
- package/docs/superpowers/specs/2026-08-01-actor-boat-design.md +204 -0
- package/docs/superpowers/specs/2026-08-01-prima-boat-design.md +242 -0
- package/docs/superpowers/specs/2026-08-03-global-config-design.md +138 -0
- package/docs/superpowers/specs/2026-08-07-prima-fixes-design.md +394 -0
- package/docs/superpowers/specs/2026-08-18-prima-false-verdicts.md +159 -0
- package/docs/web-testing/agents.md +158 -0
- package/docs/web-testing/automated-tests.md +134 -0
- package/docs/web-testing/basics.md +91 -0
- package/docs/web-testing/customization.md +131 -0
- package/docs/web-testing/hooks.md +238 -0
- package/docs/web-testing/page-interaction.md +84 -0
- package/docs/web-testing/planner.md +122 -0
- package/docs/web-testing/rerun.md +164 -0
- package/docs/web-testing/researcher.md +380 -0
- package/docs/workflow/agentic-usage.md +233 -0
- package/docs/workflow/application-spec.md +73 -0
- package/docs/workflow/ci.md +202 -0
- package/docs/workflow/knowledge.md +310 -0
- package/docs/workflow/planning-styles.md +67 -0
- package/docs/workflow/reporting.md +133 -0
- package/docs/workflow/test-plans.md +90 -0
- package/package.json +3 -2
- package/rules/navigator/verification-actions.md +20 -0
- package/src/action-result.ts +11 -0
- package/src/action.ts +43 -3
- package/src/ai/captain/web-mode.ts +6 -3
- package/src/ai/captain.ts +3 -0
- package/src/ai/navigator.ts +255 -186
- package/src/ai/pilot.ts +104 -2
- package/src/ai/provider.ts +14 -24
- package/src/ai/rerunner.ts +2 -1
- package/src/ai/researcher/cache.ts +12 -2
- package/src/ai/researcher.ts +3 -2
- package/src/ai/rules.ts +17 -10
- package/src/ai/session-analyst.ts +2 -0
- package/src/ai/task-agent.ts +3 -1
- package/src/ai/tester.ts +52 -45
- package/src/ai/tools.ts +136 -37
- package/src/commands/config-command.ts +146 -0
- package/src/commands/index.ts +2 -0
- package/src/config.ts +60 -5
- package/src/execution-controller.ts +8 -0
- package/src/explorbot.ts +7 -3
- package/src/explorer.ts +2 -2
- package/src/playwright-recorder.ts +23 -0
- package/src/remote.ts +244 -0
- package/src/reporter.ts +7 -1
- package/src/state-manager.ts +6 -2
- package/src/stats.ts +1 -0
- package/src/test-plan.ts +29 -0
- package/src/utils/aria.ts +65 -45
- package/src/utils/html.ts +1 -0
- package/src/utils/logger.ts +33 -2
- package/src/utils/page-readiness.ts +24 -1
- package/src/utils/url-matcher.ts +3 -0
- package/src/utils/web-element.ts +9 -0
- package/src/utils/web-sandbox.ts +3 -4
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Continuous Integration
|
|
2
|
+
|
|
3
|
+
Once your Explorbot setup works locally — it logs in, explores, and produces sensible tests — the next step is to run it on a schedule, so the whole app gets re-tested continuously without anyone starting it by hand. This page shows what a CI run needs and gives a worked pipeline for the common providers. If you haven't run Explorbot headlessly yet, read [Running Explorbot](../basics/running.md) first.
|
|
4
|
+
|
|
5
|
+
## What a CI run needs
|
|
6
|
+
|
|
7
|
+
- **A provider API key from the environment.** Your local `.env` file is not in the repo; in CI, set the key (for example `OPENROUTER_API_KEY`) as a pipeline secret and pass it as an environment variable.
|
|
8
|
+
- **Playwright browsers.** Install them in the job: `npx playwright install --with-deps chromium`.
|
|
9
|
+
- **A headless browser.** That's the default — don't pass `--show` and there is nothing to configure.
|
|
10
|
+
- **A start path and a test budget.** `npx explorbot explore / --max-tests 10` keeps the run bounded and predictable.
|
|
11
|
+
- **A hard timeout as backstop.** AI runs can stall; a job-level timeout guarantees the pipeline never hangs.
|
|
12
|
+
|
|
13
|
+
For login, commit your `knowledge/` directory to the repo — it's the input you control, and Explorbot reads it on every run. Keep credentials out of the files with `${env.NAME}` interpolation, as described in [Knowledge](./knowledge.md), and set those variables as pipeline secrets too. Add `--session` to the run command so Explorbot logs in once and reuses the saved session.
|
|
14
|
+
|
|
15
|
+
## Cache, commit, or upload
|
|
16
|
+
|
|
17
|
+
Three directories, three fates:
|
|
18
|
+
|
|
19
|
+
- **Commit `knowledge/`.** It's authored by you and versioned like code.
|
|
20
|
+
- **Cache `experience/` and `output/`.** `experience/` carries lessons between runs — fewer repeated failures, faster runs — so a cached CI job gets smarter every night instead of starting from zero. `output/` carries `session.json` plus previous plans and generated tests; with `--configure` the next run reloads a saved plan and re-runs its tests regression-style instead of planning everything fresh (see the [`--configure` reference](../reference/commands.md#explore)).
|
|
21
|
+
- **Upload `output/reports/`, `output/tests/`, and `output/screencasts/` as artifacts.** Reports and screencasts are for humans to review after the run; generated tests are code you may want to review and commit. If you send results to Testomat.io with artifact storage, screencasts are already attached to tests there — see [Reporting on CI](#reporting-on-ci).
|
|
22
|
+
|
|
23
|
+
## Exit codes and gating
|
|
24
|
+
|
|
25
|
+
As covered in [Running Explorbot](../basics/running.md#exit-codes), `explore` exits `1` only when the run itself crashes — bad config, unreachable app, provider failure. Failing tests do not fail the job; they are findings, not crashes. So a green pipeline means "Explorbot ran", not "no bugs found".
|
|
26
|
+
|
|
27
|
+
To see what it found, read the session report in `output/reports/` — the Analyst writes a markdown summary that clusters defects by root cause. For per-test pass/fail in machine-checkable form, enable the markdown test report or send results to Testomat.io with the `TESTOMATIO` project key; both are described in [Reporting](./reporting.md). API tests are stricter: `api test` and `api explore` exit `1` when any test fails, so they gate natively.
|
|
28
|
+
|
|
29
|
+
## Reporting on CI
|
|
30
|
+
|
|
31
|
+
A scheduled run is only worth having if its results are easy to review the next morning. The recommended stack gives you a report you read top-down — start at the overview, drill into a failing test, watch exactly what happened:
|
|
32
|
+
|
|
33
|
+
1. **Send results to Testomat.io.** Add the `TESTOMATIO` project key as a pipeline secret. Every run lands in the dashboard with steps, statuses, and history — nothing to download from CI.
|
|
34
|
+
2. **Enable artifact storage.** Connect an S3-compatible bucket under Settings > Artifacts in Testomat.io (credentials via `S3_*` pipeline variables — see [artifacts in cloud reports](./reporting.md#artifacts-in-cloud-reports)). Screenshots and screencasts attached to tests upload automatically.
|
|
35
|
+
3. **Record screencasts.** Every test becomes a video with the executed actions and the current scenario step overlaid — reviewing one beats clicking through a screenshot trail.
|
|
36
|
+
4. **Enable the Analyst.** Its summary becomes the run description on Testomat.io, so the run opens with defects clustered by root cause, coverage, and what works.
|
|
37
|
+
|
|
38
|
+
The two config switches, next to your reporter settings:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
export default {
|
|
42
|
+
ai: {
|
|
43
|
+
agents: {
|
|
44
|
+
historian: { screencast: true },
|
|
45
|
+
analyst: { enabled: true },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The review flow this buys: open the run, read the Analyst overview in the description, scan the failed tests, open one, watch its screencast.
|
|
52
|
+
|
|
53
|
+
Without the cloud reporter, the fallback is `html: true` and `markdown: true` under `reporter` plus uploading `output/reports/` and `output/screencasts/` as CI artifacts — the pipelines below do. You lose history and the overview-to-video flow, but every run is still reviewable.
|
|
54
|
+
|
|
55
|
+
**API runs** report through the same reporter, so the same `TESTOMATIO` key covers `api test` and `api explore`. There are no screencasts (no browser) and the Analyst covers web sessions only; upload `output/requests/` as a CI artifact instead — every request and response is logged there as YAML.
|
|
56
|
+
|
|
57
|
+
## GitHub Actions
|
|
58
|
+
|
|
59
|
+
A nightly run with caching, artifacts, and a manual trigger:
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
name: Explorbot Nightly
|
|
63
|
+
|
|
64
|
+
on:
|
|
65
|
+
schedule:
|
|
66
|
+
- cron: '0 3 * * *'
|
|
67
|
+
workflow_dispatch:
|
|
68
|
+
|
|
69
|
+
jobs:
|
|
70
|
+
explore:
|
|
71
|
+
runs-on: ubuntu-latest
|
|
72
|
+
timeout-minutes: 60
|
|
73
|
+
steps:
|
|
74
|
+
- uses: actions/checkout@v4
|
|
75
|
+
|
|
76
|
+
- uses: actions/setup-node@v4
|
|
77
|
+
with:
|
|
78
|
+
node-version: 24
|
|
79
|
+
|
|
80
|
+
- run: npm ci
|
|
81
|
+
- run: npx playwright install --with-deps chromium
|
|
82
|
+
|
|
83
|
+
- uses: actions/cache@v4
|
|
84
|
+
with:
|
|
85
|
+
path: |
|
|
86
|
+
experience
|
|
87
|
+
output
|
|
88
|
+
key: explorbot-${{ github.run_id }}
|
|
89
|
+
restore-keys: |
|
|
90
|
+
explorbot-
|
|
91
|
+
|
|
92
|
+
- run: npx explorbot explore / --max-tests 10 --session
|
|
93
|
+
env:
|
|
94
|
+
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
|
95
|
+
|
|
96
|
+
- uses: actions/upload-artifact@v4
|
|
97
|
+
if: always()
|
|
98
|
+
with:
|
|
99
|
+
name: explorbot-results
|
|
100
|
+
path: |
|
|
101
|
+
output/reports
|
|
102
|
+
output/tests
|
|
103
|
+
output/screencasts
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The cache key includes the run id, so every run saves an updated cache and the next one restores the latest via `restore-keys`. To report runs to Testomat.io, add `TESTOMATIO: ${{ secrets.TESTOMATIO }}` to the `env` block — see [Reporting](./reporting.md).
|
|
107
|
+
|
|
108
|
+
## GitLab CI
|
|
109
|
+
|
|
110
|
+
Create the schedule under **CI/CD → Pipeline schedules** and set `OPENROUTER_API_KEY` as a masked CI/CD variable. The job itself:
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
explorbot:
|
|
114
|
+
image: node:24
|
|
115
|
+
rules:
|
|
116
|
+
- if: $CI_PIPELINE_SOURCE == "schedule"
|
|
117
|
+
timeout: 1h
|
|
118
|
+
cache:
|
|
119
|
+
key: explorbot
|
|
120
|
+
paths:
|
|
121
|
+
- experience/
|
|
122
|
+
- output/
|
|
123
|
+
script:
|
|
124
|
+
- npm ci
|
|
125
|
+
- npx playwright install --with-deps chromium
|
|
126
|
+
- npx explorbot explore / --max-tests 10 --session
|
|
127
|
+
artifacts:
|
|
128
|
+
when: always
|
|
129
|
+
paths:
|
|
130
|
+
- output/reports/
|
|
131
|
+
- output/tests/
|
|
132
|
+
- output/screencasts/
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Jenkins
|
|
136
|
+
|
|
137
|
+
Jenkins has no built-in cross-run cache, but the workspace persists between builds on the same agent — so `experience/` and `output/` carry over as long as you don't wipe the workspace (skip `cleanWs`, or use the Job Cacher plugin on those two directories).
|
|
138
|
+
|
|
139
|
+
```groovy
|
|
140
|
+
pipeline {
|
|
141
|
+
agent any
|
|
142
|
+
triggers { cron('H 3 * * *') }
|
|
143
|
+
options { timeout(time: 60, unit: 'MINUTES') }
|
|
144
|
+
environment { OPENROUTER_API_KEY = credentials('openrouter-api-key') }
|
|
145
|
+
stages {
|
|
146
|
+
stage('Explore') {
|
|
147
|
+
steps {
|
|
148
|
+
sh 'npm ci'
|
|
149
|
+
sh 'npx playwright install --with-deps chromium'
|
|
150
|
+
sh 'npx explorbot explore / --max-tests 10 --session'
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
post {
|
|
155
|
+
always {
|
|
156
|
+
archiveArtifacts artifacts: 'output/reports/**, output/tests/**, output/screencasts/**', allowEmptyArchive: true
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Azure Pipelines
|
|
163
|
+
|
|
164
|
+
Scheduled triggers are declared in the pipeline itself; `always: true` runs it even without new commits. Set the API key as a secret pipeline variable. Azure caches one path per `Cache@2` task and keys are immutable, so use two tasks with the same rolling-key pattern as the GitHub example.
|
|
165
|
+
|
|
166
|
+
```yaml
|
|
167
|
+
schedules:
|
|
168
|
+
- cron: '0 3 * * *'
|
|
169
|
+
branches:
|
|
170
|
+
include: [main]
|
|
171
|
+
always: true
|
|
172
|
+
|
|
173
|
+
pool:
|
|
174
|
+
vmImage: ubuntu-latest
|
|
175
|
+
|
|
176
|
+
steps:
|
|
177
|
+
- task: NodeTool@0
|
|
178
|
+
inputs:
|
|
179
|
+
versionSpec: '24.x'
|
|
180
|
+
- task: Cache@2
|
|
181
|
+
inputs:
|
|
182
|
+
key: 'explorbot | "$(Build.BuildId)"'
|
|
183
|
+
restoreKeys: 'explorbot'
|
|
184
|
+
path: experience
|
|
185
|
+
- task: Cache@2
|
|
186
|
+
inputs:
|
|
187
|
+
key: 'explorbot-output | "$(Build.BuildId)"'
|
|
188
|
+
restoreKeys: 'explorbot-output'
|
|
189
|
+
path: output
|
|
190
|
+
- script: |
|
|
191
|
+
npm ci
|
|
192
|
+
npx playwright install --with-deps chromium
|
|
193
|
+
npx explorbot explore / --max-tests 10 --session
|
|
194
|
+
timeoutInMinutes: 60
|
|
195
|
+
env:
|
|
196
|
+
OPENROUTER_API_KEY: $(OPENROUTER_API_KEY)
|
|
197
|
+
- task: PublishPipelineArtifact@1
|
|
198
|
+
condition: always()
|
|
199
|
+
inputs:
|
|
200
|
+
targetPath: output/reports
|
|
201
|
+
artifact: explorbot-reports
|
|
202
|
+
```
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# Knowledge System
|
|
2
|
+
|
|
3
|
+
Knowledge files tell explorbot facts about your app. Agents read them to make better decisions about authentication, special workflows, and app-specific behavior.
|
|
4
|
+
|
|
5
|
+
## Adding Knowledge
|
|
6
|
+
|
|
7
|
+
### Interactive Mode
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx explorbot learn
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Opens a TUI form where you can:
|
|
14
|
+
- Enter a URL pattern
|
|
15
|
+
- See existing knowledge for that URL
|
|
16
|
+
- Add new knowledge
|
|
17
|
+
|
|
18
|
+
### CLI Mode
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx explorbot learn "<url-pattern>" "<description>"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Examples:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Login credentials
|
|
28
|
+
npx explorbot learn "/login" "Use credentials: admin@example.com / secret123"
|
|
29
|
+
|
|
30
|
+
# General knowledge (applies to all pages)
|
|
31
|
+
npx explorbot learn "*" "This is a React SPA. Wait for loading spinners to disappear."
|
|
32
|
+
|
|
33
|
+
# Specific page behavior
|
|
34
|
+
npx explorbot learn "/checkout" "Credit card field requires format: XXXX-XXXX-XXXX-XXXX"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Inside TUI
|
|
38
|
+
|
|
39
|
+
While exploring, use the `/learn` command.
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
/learn # Opens interactive form
|
|
43
|
+
/learn Test user: test@example.com # Adds to current page
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### API Testing
|
|
47
|
+
|
|
48
|
+
[API testing](../api-testing/basics.md) shares the same `knowledge/` directory. `npx explorbot api know <endpoint> "<description>"` adds endpoint-scoped notes, stored with an `endpoint:` frontmatter field instead of `url:`.
|
|
49
|
+
|
|
50
|
+
## URL Patterns
|
|
51
|
+
|
|
52
|
+
| Pattern | Matches |
|
|
53
|
+
|---------|---------|
|
|
54
|
+
| `/login` | Exact path `/login` |
|
|
55
|
+
| `/admin/*` | Any path starting with `/admin/` |
|
|
56
|
+
| `*` | All pages (general knowledge) |
|
|
57
|
+
| `^/users/\d+` | Regex: `/users/` followed by digits |
|
|
58
|
+
| `~dashboard~` | Regex: "dashboard" anywhere in URL (tilde on both sides) |
|
|
59
|
+
|
|
60
|
+
## Knowledge File Format
|
|
61
|
+
|
|
62
|
+
Knowledge lives in `./knowledge/` as markdown files with frontmatter:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
---
|
|
66
|
+
url: /login
|
|
67
|
+
title: Login Page
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
Test credentials:
|
|
71
|
+
- email: admin@example.com
|
|
72
|
+
- password: secret123
|
|
73
|
+
|
|
74
|
+
Notes:
|
|
75
|
+
- Submit button disabled until email validates
|
|
76
|
+
- 3 failed attempts triggers captcha
|
|
77
|
+
- "Remember me" checkbox persists session for 30 days
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Frontmatter Fields
|
|
81
|
+
|
|
82
|
+
| Field | Purpose |
|
|
83
|
+
|-------|---------|
|
|
84
|
+
| `url` | URL pattern to match (optional, defaults to `*`) |
|
|
85
|
+
| `title` | Human-readable title (optional) |
|
|
86
|
+
| Custom fields | Any additional metadata for agents |
|
|
87
|
+
|
|
88
|
+
## Variables
|
|
89
|
+
|
|
90
|
+
Knowledge files support variable interpolation with `${namespace.key}` syntax. Explorbot resolves variables when it loads the knowledge.
|
|
91
|
+
|
|
92
|
+
### Environment Variables
|
|
93
|
+
|
|
94
|
+
Use `${env.VARNAME}` to reference environment variables. This keeps secrets out of knowledge files.
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
---
|
|
98
|
+
url: /login
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
Login credentials:
|
|
102
|
+
- email: ${env.LOGIN}
|
|
103
|
+
- password: ${env.PASSWORD}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Missing environment variables become an empty string.
|
|
107
|
+
|
|
108
|
+
### Config Variables
|
|
109
|
+
|
|
110
|
+
Use `${config.path}` to reference values from `explorbot.config.js` with dot notation.
|
|
111
|
+
|
|
112
|
+
```markdown
|
|
113
|
+
---
|
|
114
|
+
url: *
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
Base URL: ${config.playwright.url}
|
|
118
|
+
Browser: ${config.playwright.browser}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
You can reference any scalar config value. Object values become an empty string.
|
|
122
|
+
|
|
123
|
+
### Supported Namespaces
|
|
124
|
+
|
|
125
|
+
| Namespace | Source | Example |
|
|
126
|
+
|-----------|--------|---------|
|
|
127
|
+
| `env` | `process.env` | `${env.API_KEY}` |
|
|
128
|
+
| `config` | `explorbot.config.js` | `${config.playwright.url}` |
|
|
129
|
+
|
|
130
|
+
Expressions with an unknown namespace (such as `${other.value}`) or no namespace (such as `${value}`) are left as-is.
|
|
131
|
+
|
|
132
|
+
## Page Automation
|
|
133
|
+
|
|
134
|
+
Knowledge files can run automation commands when explorbot navigates to a matching page. Use this for loading states, cookie banners, or page-specific setup.
|
|
135
|
+
|
|
136
|
+
### Available Fields
|
|
137
|
+
|
|
138
|
+
| Field | Type | Description |
|
|
139
|
+
|-------|------|-------------|
|
|
140
|
+
| `wait` | `number` | Wait for specified seconds after page load |
|
|
141
|
+
| `waitForElement` | `string` | Wait for element to appear (CSS selector) |
|
|
142
|
+
| `code` | `string` | Execute CodeceptJS code after navigation |
|
|
143
|
+
| `statePush` | `boolean` | Use `history.pushState` instead of full navigation |
|
|
144
|
+
|
|
145
|
+
### Wait for Page Load
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
---
|
|
149
|
+
url: /dashboard
|
|
150
|
+
wait: 2
|
|
151
|
+
waitForElement: '.dashboard-loaded'
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
Dashboard requires data to load before interaction.
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Execute Custom Code
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
---
|
|
161
|
+
url: /app/*
|
|
162
|
+
code: |
|
|
163
|
+
I.waitForElement('.app-ready');
|
|
164
|
+
I.click('.cookie-accept');
|
|
165
|
+
I.wait(1);
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
App pages need cookie consent dismissed and loading complete.
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### CodeceptJS Effects
|
|
172
|
+
|
|
173
|
+
Knowledge code can use CodeceptJS effects for error handling and retries:
|
|
174
|
+
|
|
175
|
+
| Effect | Purpose |
|
|
176
|
+
|--------|---------|
|
|
177
|
+
| `tryTo(fn)` | Execute without failing - returns `true`/`false` |
|
|
178
|
+
| `retryTo(fn, maxTries, interval)` | Retry on failure with polling |
|
|
179
|
+
| `within(context, fn)` | Execute within a specific element context |
|
|
180
|
+
|
|
181
|
+
**Example with effects:**
|
|
182
|
+
|
|
183
|
+
```markdown
|
|
184
|
+
---
|
|
185
|
+
url: /dashboard
|
|
186
|
+
code: |
|
|
187
|
+
await tryTo(() => I.click('.cookie-dismiss'));
|
|
188
|
+
await retryTo(() => {
|
|
189
|
+
I.click('Reload Data');
|
|
190
|
+
I.waitForElement('.data-loaded');
|
|
191
|
+
}, 5, 500);
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
Dashboard may show cookie banner. Data loads asynchronously - retry reload if needed.
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
> [!NOTE]
|
|
198
|
+
> Effects are async. Use `await` when you call them in knowledge code.
|
|
199
|
+
|
|
200
|
+
### SPA Navigation
|
|
201
|
+
|
|
202
|
+
For single-page apps where a full reload breaks state:
|
|
203
|
+
|
|
204
|
+
```markdown
|
|
205
|
+
---
|
|
206
|
+
url: /settings/*
|
|
207
|
+
statePush: true
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
Settings uses client-side routing. Use pushState to preserve app state.
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
> [!TIP]
|
|
214
|
+
> Use knowledge automation for page-specific behavior. For agent-specific logic, such as code that runs only during testing, use [Agent Hooks](../web-testing/hooks.md) instead.
|
|
215
|
+
|
|
216
|
+
### Execution Order
|
|
217
|
+
|
|
218
|
+
When explorbot navigates to a page, automation runs in this order:
|
|
219
|
+
|
|
220
|
+
1. Navigation (`I.amOnPage()` or `history.pushState`)
|
|
221
|
+
2. `wait` (if specified)
|
|
222
|
+
3. `waitForElement` (if specified)
|
|
223
|
+
4. `code` (if specified)
|
|
224
|
+
|
|
225
|
+
## What to Document
|
|
226
|
+
|
|
227
|
+
### Authentication
|
|
228
|
+
|
|
229
|
+
```markdown
|
|
230
|
+
---
|
|
231
|
+
url: /login
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
Credentials: test@example.com / testpass123
|
|
235
|
+
OAuth: Use "Continue with Google" for SSO testing
|
|
236
|
+
2FA: Code is always 123456 in test environment
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Form Behavior
|
|
240
|
+
|
|
241
|
+
```markdown
|
|
242
|
+
---
|
|
243
|
+
url: /checkout
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
Required fields: name, email, card number, expiry, CVV
|
|
247
|
+
Card format: XXXX-XXXX-XXXX-XXXX
|
|
248
|
+
Test card: 4111-1111-1111-1111, any future expiry, any CVV
|
|
249
|
+
Promo code "TEST10" gives 10% discount
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Navigation Quirks
|
|
253
|
+
|
|
254
|
+
```markdown
|
|
255
|
+
---
|
|
256
|
+
url: *
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
- App uses React Router, wait for route transitions
|
|
260
|
+
- Loading spinner class: .spinner-overlay
|
|
261
|
+
- Modals block interaction until dismissed
|
|
262
|
+
- Session expires after 15 minutes of inactivity
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Test Data
|
|
266
|
+
|
|
267
|
+
```markdown
|
|
268
|
+
---
|
|
269
|
+
url: /users
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
Test users available:
|
|
273
|
+
- admin@test.com (admin role)
|
|
274
|
+
- user@test.com (standard user)
|
|
275
|
+
- readonly@test.com (view-only permissions)
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## How Agents Use Knowledge
|
|
279
|
+
|
|
280
|
+
When an agent works on a page, it gets the knowledge whose URL pattern matches:
|
|
281
|
+
|
|
282
|
+
1. **Navigator** — uses credentials and knows about special interactions
|
|
283
|
+
2. **Researcher** — reads page structure and hidden elements
|
|
284
|
+
3. **Planner** — adds edge cases and validation rules to test scenarios
|
|
285
|
+
4. **Tester** — uses test data and expected behaviors
|
|
286
|
+
|
|
287
|
+
## Best Practices
|
|
288
|
+
|
|
289
|
+
1. **Start with auth** — add login credentials before exploring protected areas
|
|
290
|
+
2. **Use `*` for globals** — document app-wide behavior such as loading states and timeouts
|
|
291
|
+
3. **Be specific** — give exact selectors, formats, and values when you know them
|
|
292
|
+
4. **Update as you learn** — add knowledge when agents struggle with an interaction
|
|
293
|
+
|
|
294
|
+
## File Organization
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
./knowledge/
|
|
298
|
+
├── login.md # /login page
|
|
299
|
+
├── checkout.md # /checkout page
|
|
300
|
+
├── general.md # * (all pages)
|
|
301
|
+
└── admin_users.md # /admin/users/*
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Files are named after the URL pattern. Multiple entries for the same URL append to the same file.
|
|
305
|
+
|
|
306
|
+
## See Also
|
|
307
|
+
|
|
308
|
+
- [Agent Hooks](../web-testing/hooks.md) — per-agent custom code execution
|
|
309
|
+
- [Configuration](../reference/configuration.md) — full configuration reference
|
|
310
|
+
- [Page Interaction](../web-testing/page-interaction.md) — how agents interact with pages
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Planning Styles
|
|
2
|
+
|
|
3
|
+
A planning style is a markdown rule file that shapes what scenarios get planned. The whole file becomes the planning approach in the agent's prompt — written as instructions to a QA engineer on how to think about test scenarios.
|
|
4
|
+
|
|
5
|
+
Two agents use styles through the same mechanism: the web [Planner](../web-testing/planner.md) and the API [Chief](../api-testing/basics.md).
|
|
6
|
+
|
|
7
|
+
## Built-in Styles
|
|
8
|
+
|
|
9
|
+
Bundled style files live in `rules/planner/styles/` (web) and `rules/chief/styles/` (API):
|
|
10
|
+
|
|
11
|
+
| Style | Intent |
|
|
12
|
+
|-------|--------|
|
|
13
|
+
| `normal` | Complete user workflows: CRUD and full commit flows that end in a data or state change |
|
|
14
|
+
| `curious` | Coverage gaps: mines previous test results and research to find paths earlier tests missed |
|
|
15
|
+
| `psycho` | Stress tests: feeds empty, invalid, and extreme values to every reachable control, then commits |
|
|
16
|
+
| `hacker` | API only: probes beyond the spec — hidden endpoints, undocumented fields, unprotected actions |
|
|
17
|
+
|
|
18
|
+
## Cycling
|
|
19
|
+
|
|
20
|
+
Each planning iteration uses the next style in the list, cycling by index.
|
|
21
|
+
|
|
22
|
+
**Web Planner** — default order is `normal`, `curious`, `psycho`. The first `/plan` uses normal, the second curious, the third psycho, then the cycle repeats. Override the list and order with the `styles` option in [Planner configuration](../web-testing/planner.md#configuration); a name may appear more than once.
|
|
23
|
+
|
|
24
|
+
**API Chief** — order is `normal`, `curious`, `psycho`, `hacker`. `api plan` cycles them the same way. `api explore` doesn't cycle: it runs every style once, generating and executing a plan per style.
|
|
25
|
+
|
|
26
|
+
## Selecting a Style
|
|
27
|
+
|
|
28
|
+
Force a style for a single run:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx explorbot plan /users --style psycho # web
|
|
32
|
+
npx explorbot api plan /users --style hacker # API
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The web TUI accepts the same flag: `/plan --style psycho`. `api explore` has no `--style` flag — it always runs all styles.
|
|
36
|
+
|
|
37
|
+
## Custom Styles
|
|
38
|
+
|
|
39
|
+
Styles load from `rules/<agent>/styles/<name>.md` in your project first, falling back to the bundled file of the same name. To edit built-in styles, copy the bundled rules into your project:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx explorbot extract-rules planner # or: chief
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This copies the agent's bundled rule files (including styles) to `./rules/<agent>/`, skipping files that already exist. Edit the copies — they take precedence over the bundled versions. Extract only what you want to change; anything you delete falls back to the bundled file.
|
|
46
|
+
|
|
47
|
+
Style files are plain markdown with no frontmatter. Write the mindset, the patterns to test, what counts as a test, and what to skip.
|
|
48
|
+
|
|
49
|
+
To add a new web style, create `rules/planner/styles/<name>.md` and add its name to the rotation:
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
ai: {
|
|
53
|
+
agents: {
|
|
54
|
+
planner: {
|
|
55
|
+
styles: ['normal', 'curious', 'psycho', 'security'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The API Chief has no `styles` config option — customize it by overriding the built-in style files in `rules/chief/styles/`.
|
|
62
|
+
|
|
63
|
+
## See Also
|
|
64
|
+
|
|
65
|
+
- [Planner](../web-testing/planner.md) — how web test plans are generated
|
|
66
|
+
- [API Testing](../api-testing/basics.md) — the Chief agent and API commands
|
|
67
|
+
- [Test Plans](./test-plans.md) — the plan file format
|