Skip to content

feat(replay): execute scripted steps in native test workflows - #3438

Open
xiong35 wants to merge 1 commit into
mainfrom
feat/replay-runtime-native-test
Open

xiong35 wants to merge 1 commit into
mainfrom
feat/replay-runtime-native-test

Conversation

@xiong35

@xiong35 xiong35 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Native Test AI nodes currently require the native AI implementation for every execution. This adds optional per-node Replay scripts: an aiAct can click a strict target and verify its receipt, while Test continues to own setup, cancellation, Case retries, result conversion and the integrated HTML report.

The new @midscene/replay runtime provides ready/run/done steps, deterministic Web actions, explicit locator fallback, popup following and Jev visual checks. YAML and SDK execution support auto, strict and off; returned assertion failures, invalid results, cancellation and terminal resource errors never trigger AI fallback. Core/Shared/Web changes supply deterministic dispatch, explicit readiness, Jev image mapping and reliable drag cleanup. Jev uses one internal judgment contract and events use the instance-level onEvent callback.

This is the first of three planned PRs. Browser recording and authoring/verification commands are outside this PR. The package has bilingual runtime documentation, browser regression coverage and an independent YAML → Replay → native-report integration test.

Validation

Passed in the isolated PR worktree based on origin/main:

  • pnpm install --frozen-lockfile --ignore-scripts
  • pnpm run lint
  • pnpm run check:references
  • pnpm run check-dependency-version
  • pnpm exec nx build <project> --excludeTaskDependencies --skip-nx-cache --output-style=static for @midscene/shared, @midscene/core, @midscene/web, @midscene/test and @midscene/replay.
  • pnpm exec nx test @midscene/replay --output-style=static: 50 tests passed.
  • pnpm exec nx test @midscene/test --output-style=static: 743 tests passed.
  • pnpm exec nx test @midscene/core --include='tests/unit-test/{agent-action-readiness,agent-custom-model,jev,task-executor-custom-planning}.test.ts' --output-style=static: 119 tests passed.
  • pnpm exec nx test @midscene/shared --include='tests/unit-test/{env/modle-config-manager,extractor-visibility}.test.ts' --output-style=static: 33 tests passed.
  • pnpm exec nx test @midscene/web --include='tests/unit-test/web-page-drag.test.ts' --output-style=static: 2 tests passed.
  • One-off external package smoke (node /private/tmp/replay-pr1-package-smoke.mjs): packed and installed six workspace tarballs, compiled a strict TypeScript runtime consumer, ran pnpm exec midscene-test case.yaml --replay=strict, and verified the generated native HTML report.

Browser tests used the locally installed Chromium via PUPPETEER_EXECUTABLE_PATH; CI installs its own browser. Jev tests mock model responses; no live-model validation or full monorepo test run was performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant