























@@ -161,6 +161,13 @@ run_wizard() {
161161 run_wizard_cmd "$case_name" "$state_ref" "node \"$OPENCLAW_ENTRY\" onboard $ONBOARD_FLAGS" "$send_fn" true "$validate_fn"
162162}
163163164+assert_onboard_config() {
165+local scenario="$1"
166+shift
167+ openclaw_e2e_assert_file "$OPENCLAW_CONFIG_PATH"
168+ node scripts/e2e/lib/onboard/assert-config.mjs "$scenario" "$OPENCLAW_CONFIG_PATH" "$@"
169+}
170+164171set_isolated_openclaw_env() {
165172local state_ref="$1"
166173 openclaw_test_state_create "$state_ref" empty
@@ -230,16 +237,14 @@ run_case_local_basic() {
230237231238# Assert config + workspace scaffolding.
232239 workspace_dir="$OPENCLAW_STATE_DIR/workspace"
233- config_path="$OPENCLAW_CONFIG_PATH"
234240 sessions_dir="$OPENCLAW_STATE_DIR/agents/main/sessions"
235241236- openclaw_e2e_assert_file "$config_path"
237242 openclaw_e2e_assert_dir "$sessions_dir"
238243for file in AGENTS.md BOOTSTRAP.md IDENTITY.md SOUL.md TOOLS.md USER.md; do
239244 openclaw_e2e_assert_file "$workspace_dir/$file"
240245done
241246242-node scripts/e2e/lib/onboard/assert-config.mjs local-basic "$config_path" "$workspace_dir"
247+assert_onboard_config local-basic "$workspace_dir"
243248244249}
245250@@ -253,25 +258,12 @@ run_case_remote_non_interactive() {
253258 --skip-skills \
254259 --skip-health
255260256- config_path="$OPENCLAW_CONFIG_PATH"
257- openclaw_e2e_assert_file "$config_path"
258-259- node scripts/e2e/lib/onboard/assert-config.mjs remote-non-interactive "$config_path"
261+ assert_onboard_config remote-non-interactive
260262}
261263262264run_case_reset() {
263265 set_isolated_openclaw_env reset-config
264-# Seed a remote config to exercise reset path.
265- cat >"$OPENCLAW_CONFIG_PATH" <<'JSON'
266-{
267-"meta": {},
268-"agents": { "defaults": { "workspace": "/root/old" } },
269-"gateway": {
270- "mode": "remote",
271- "remote": { "url": "ws://old.example:18789", "token": "old-token" }
272-}
273-}
274-JSON
266+ node scripts/e2e/lib/onboard/write-config.mjs reset "$OPENCLAW_CONFIG_PATH"
275267276268 openclaw_e2e_run_logged reset-config node "$OPENCLAW_ENTRY" onboard \
277269 --non-interactive \
@@ -285,43 +277,25 @@ JSON
285277 --skip-ui \
286278 --skip-health
287279288- config_path="$OPENCLAW_CONFIG_PATH"
289- openclaw_e2e_assert_file "$config_path"
290-291- node scripts/e2e/lib/onboard/assert-config.mjs reset "$config_path"
280+ assert_onboard_config reset
292281}
293282294283run_case_channels() {
295284# Channels-only configure flow.
296285 run_wizard_cmd channels channels "node \"$OPENCLAW_ENTRY\" configure --section channels" send_channels_flow
297286298- config_path="$OPENCLAW_CONFIG_PATH"
299- openclaw_e2e_assert_file "$config_path"
300-301- node scripts/e2e/lib/onboard/assert-config.mjs channels "$config_path"
287+ assert_onboard_config channels
302288}
303289304290run_case_skills() {
305291local home_dir
306292 set_isolated_openclaw_env skills
307293 home_dir="$HOME"
308-# Seed skills config to ensure it survives the wizard.
309- cat >"$OPENCLAW_CONFIG_PATH" <<'JSON'
310-{
311-"meta": {},
312-"skills": {
313- "allowBundled": ["__none__"],
314- "install": { "nodeManager": "bun" }
315-}
316-}
317-JSON
294+ node scripts/e2e/lib/onboard/write-config.mjs skills "$OPENCLAW_CONFIG_PATH"
318295319296 run_wizard_cmd skills "$home_dir" "node \"$OPENCLAW_ENTRY\" configure --section skills" send_skills_flow
320297321- config_path="$OPENCLAW_CONFIG_PATH"
322- openclaw_e2e_assert_file "$config_path"
323-324- node scripts/e2e/lib/onboard/assert-config.mjs skills "$config_path"
298+ assert_onboard_config skills
325299}
326300327301validate_local_basic_log() {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。