Skip to content

Commit 4514c6b

Browse files
committed
test: align onboarding TTY prompts (oc-efc)
1 parent 7ce902c commit 4514c6b

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

‎scripts/e2e/lib/onboard/scenario.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ send_skills_flow() {
243243
}
244244

245245
send_guided_skip_ui_flow() {
246+
wait_for_log "What should we call your first agent?" 120 || return $?
247+
send $'\r' 0.8
246248
wait_for_log "How should I set things up?" 120 || return $?
247249
send $'\r' 0.8
248250
wait_for_log "Use Current model?" 120 || return $?

‎scripts/e2e/lib/release-typed-onboarding/scenario.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ exec 3>"$input_fifo"
105105

106106
wait_for_log "Continue?" 60
107107
send $'y\r' 0.4
108+
wait_for_log "What should we call your first agent?" 60
109+
send $'\r' 0.4
108110
wait_for_log "to search" 60
109111
send $'ollama\r' 0.4
110112

‎test/scripts/docker-build-helper.test.ts‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const AGENTS_DELETE_SHARED_WORKSPACE_DOCKER_E2E_PATH =
3232
"scripts/e2e/agents-delete-shared-workspace-docker.sh";
3333
const OPENWEBUI_DOCKER_E2E_PATH = "scripts/e2e/openwebui-docker.sh";
3434
const ONBOARD_DOCKER_E2E_PATH = "scripts/e2e/onboard-docker.sh";
35+
const ONBOARD_SCENARIO_PATH = "scripts/e2e/lib/onboard/scenario.sh";
3536
const KITCHEN_SINK_PLUGIN_DOCKER_E2E_PATH = "scripts/e2e/kitchen-sink-plugin-docker.sh";
3637
const KITCHEN_SINK_RPC_DOCKER_E2E_PATH = "scripts/e2e/kitchen-sink-rpc-docker.sh";
3738
const CODEX_ON_DEMAND_DOCKER_E2E_PATH = "scripts/e2e/codex-on-demand-docker.sh";
@@ -127,6 +128,16 @@ function extractUpgradeSurvivorPayload(script: string) {
127128
}
128129
return quoted.slice(1, -1).replaceAll(`'"'"'`, "'");
129130
}
131+
132+
// Prompt-driving scripts must consume public prompts in the order the CLI renders them.
133+
function expectOrderedScriptFragments(script: string, fragments: readonly string[]): void {
134+
let offset = 0;
135+
for (const fragment of fragments) {
136+
const index = script.indexOf(fragment, offset);
137+
expect(index, `missing ordered script fragment: ${fragment}`).toBeGreaterThanOrEqual(offset);
138+
offset = index + fragment.length;
139+
}
140+
}
130141
const BOUNDED_CLIENT_LOG_DOCKER_E2E_SCRIPTS = [
131142
"scripts/e2e/cron-mcp-cleanup-docker.sh",
132143
"scripts/e2e/mcp-channels-docker.sh",
@@ -2619,6 +2630,25 @@ docker_e2e_docker_run_cmd run demo
26192630
expect(script).not.toContain('"$HOME/.openclaw/agents/main/agent/auth-profiles.json"');
26202631
});
26212632

2633+
it("keeps real-TTY onboarding drivers aligned with the first-agent prompt", () => {
2634+
expectOrderedScriptFragments(readFileSync(RELEASE_TYPED_ONBOARDING_SCENARIO_PATH, "utf8"), [
2635+
'wait_for_log "Continue?"',
2636+
"send $'y\\r'",
2637+
'wait_for_log "What should we call your first agent?"',
2638+
"send $'\\r'",
2639+
'wait_for_log "to search"',
2640+
"send $'ollama\\r'",
2641+
]);
2642+
expectOrderedScriptFragments(readFileSync(ONBOARD_SCENARIO_PATH, "utf8"), [
2643+
'wait_for_log "What should we call your first agent?"',
2644+
"send $'\\r'",
2645+
'wait_for_log "How should I set things up?"',
2646+
"send $'\\r'",
2647+
'wait_for_log "Use Current model?"',
2648+
"send $'\\r'",
2649+
]);
2650+
});
2651+
26222652
it("keeps append-only mock E2E state under per-run scratch roots", () => {
26232653
const scripts = [
26242654
{

0 commit comments

Comments
 (0)