@midscene/test 1.17.6 → 1.17.7

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.
@@ -16,6 +16,6 @@ Run tests with `{{TEST_COMMAND}}`. Read `midscene-node-spec.android.md` for the
16
16
 
17
17
  After changing Node registrations in `midscene.config.ts`, run `{{RUN_NODES_COMMAND}}` to refresh the spec. This loads the configuration without connecting to a device or running tests. Extension factories must only acquire runtime resources inside Node execution.
18
18
 
19
- Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and connections are released on failure. Reports are written to `midscene_run/report/`.
19
+ Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and connections are released on failure. Reports are written to `midscene_run/report/`; structured results and diagnostic records are saved in `midscene_run/test-results/<runId>/`. Set `MIDSCENE_RUN_DIR` to change the artifact root.
20
20
 
21
21
  Each test file creates its own Agent through `fileSetup` and releases it afterward. The Project is limited to one file at a time because this starter connects to a single device or desktop. Before increasing the Project limit, provide independent devices/displays through your resource allocator.
@@ -8,6 +8,6 @@
8
8
 
9
9
  连接设备并用 `adb devices` 确认;可设置 `ANDROID_DEVICE_ID` 指定设备。`cases/todo.yaml` 打开在线 React TodoMVC,添加三个任务、删除一个、完成另一个、筛选已完成任务,并校验可见任务和未完成数量。设备需要能访问该网站;`beforeEach` 先执行 `midscene.config.ts` 中的 `todo.setup`,打开 All 视图并等待输入框加载,再由 `aiAssert` 确认列表为空(包含已完成任务)且没有遮挡弹窗。已有任务会保留;检查失败时,用例会在修改任务前停止。请切换到 All,删除全部任务(包括已完成任务),或仅清除 TodoMVC 网站的数据;关闭遮挡弹窗后重新运行。模型或连接异常应先按报告中的原因排查。AI 检查可能误判,失败时请结合报告确认页面状态。
10
10
 
11
- 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.android.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并释放连接。报告位于 `midscene_run/report/`。
11
+ 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.android.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并释放连接。报告位于 `midscene_run/report/`,结构化结果与诊断记录位于 `midscene_run/test-results/<runId>/`。可通过 `MIDSCENE_RUN_DIR` 修改产物根。
12
12
 
13
13
  每份测试文件通过 `fileSetup` 创建独立 Agent,结束后释放。此模板连接一台设备或一个桌面,因此 Project 的 `maxConcurrentFiles` 固定为 1;提高此上限前,需要通过资源分配脚本为并发文件提供独立设备或桌面。
@@ -1,4 +1,3 @@
1
1
  node_modules/
2
2
  .env
3
3
  midscene_run/
4
- .midscene/test-results/
@@ -16,6 +16,6 @@ Run tests with `{{TEST_COMMAND}}`. Read `midscene-node-spec.computer.md` for the
16
16
 
17
17
  After changing Node registrations in `midscene.config.ts`, run `{{RUN_NODES_COMMAND}}` to refresh the spec. This loads the configuration without connecting to a device or running tests. Extension factories must only acquire runtime resources inside Node execution.
18
18
 
19
- Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and connections are released on failure. Reports are written to `midscene_run/report/`.
19
+ Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and connections are released on failure. Reports are written to `midscene_run/report/`; structured results and diagnostic records are saved in `midscene_run/test-results/<runId>/`. Set `MIDSCENE_RUN_DIR` to change the artifact root.
20
20
 
21
21
  Each test file creates its own Agent through `fileSetup` and releases it afterward. The Project is limited to one file at a time because this starter connects to a single device or desktop. Before increasing the Project limit, provide independent devices/displays through your resource allocator.
@@ -8,6 +8,6 @@
8
8
 
9
9
  按照[桌面环境指南](https://midscenejs.com/platforms/desktop.html)准备权限和依赖。可设置 `COMPUTER_DISPLAY_ID` 选择显示器;无头 Linux 需要 Xvfb 和 `MIDSCENE_COMPUTER_HEADLESS_LINUX`。`cases/todo.yaml` 在 macOS 使用 Safari、在 Windows/Linux 使用 Chrome 打开在线 React TodoMVC,添加三个任务、删除一个、完成另一个、筛选已完成任务,并校验任务名称及输入框占位文字。桌面需要能访问该网站;`beforeEach` 先执行 `midscene.config.ts` 中的 `todo.setup`,打开 All 视图并等待输入框加载,再由 `aiAssert` 确认列表为空(包含已完成任务)且没有遮挡弹窗。已有任务会保留;检查失败时,用例会在修改任务前停止。请切换到 All,删除全部任务(包括已完成任务),或仅清除 TodoMVC 网站的数据;关闭遮挡弹窗后重新运行。模型或连接异常应先按报告中的原因排查。AI 检查可能误判,失败时请结合报告确认页面状态。
10
10
 
11
- 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.computer.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并释放连接。报告位于 `midscene_run/report/`。
11
+ 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.computer.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并释放连接。报告位于 `midscene_run/report/`,结构化结果与诊断记录位于 `midscene_run/test-results/<runId>/`。可通过 `MIDSCENE_RUN_DIR` 修改产物根。
12
12
 
13
13
  每份测试文件通过 `fileSetup` 创建独立 Agent,结束后释放。此模板连接一台设备或一个桌面,因此 Project 的 `maxConcurrentFiles` 固定为 1;提高此上限前,需要通过资源分配脚本为并发文件提供独立设备或桌面。
@@ -1,4 +1,3 @@
1
1
  node_modules/
2
2
  .env
3
3
  midscene_run/
4
- .midscene/test-results/
@@ -16,6 +16,6 @@ Run tests with `{{TEST_COMMAND}}`. Read `midscene-node-spec.harmony.md` for the
16
16
 
17
17
  After changing Node registrations in `midscene.config.ts`, run `{{RUN_NODES_COMMAND}}` to refresh the spec. This loads the configuration without connecting to a device or running tests. Extension factories must only acquire runtime resources inside Node execution.
18
18
 
19
- Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and connections are released on failure. Reports are written to `midscene_run/report/`.
19
+ Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and connections are released on failure. Reports are written to `midscene_run/report/`; structured results and diagnostic records are saved in `midscene_run/test-results/<runId>/`. Set `MIDSCENE_RUN_DIR` to change the artifact root.
20
20
 
21
21
  Each test file creates its own Agent through `fileSetup` and releases it afterward. The Project is limited to one file at a time because this starter connects to a single device or desktop. Before increasing the Project limit, provide independent devices/displays through your resource allocator.
@@ -8,6 +8,6 @@
8
8
 
9
9
  连接设备并用 `hdc list targets` 确认;可设置 `HARMONY_DEVICE_ID` 指定设备,必要时设置 `HDC_HOME`。`cases/todo.yaml` 在浏览器打开在线 React TodoMVC,添加三个任务、删除一个、完成另一个、筛选已完成任务,并校验可见任务和未完成数量。设备需要能访问该网站;`beforeEach` 先执行 `midscene.config.ts` 中的 `todo.setup`,打开 All 视图并等待输入框加载,再由 `aiAssert` 确认列表为空(包含已完成任务)且没有遮挡弹窗。已有任务会保留;检查失败时,用例会在修改任务前停止。请切换到 All,删除全部任务(包括已完成任务),或仅清除 TodoMVC 网站的数据;关闭遮挡弹窗后重新运行。模型或连接异常应先按报告中的原因排查。AI 检查可能误判,失败时请结合报告确认页面状态。
10
10
 
11
- 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.harmony.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并释放连接。报告位于 `midscene_run/report/`。
11
+ 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.harmony.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并释放连接。报告位于 `midscene_run/report/`,结构化结果与诊断记录位于 `midscene_run/test-results/<runId>/`。可通过 `MIDSCENE_RUN_DIR` 修改产物根。
12
12
 
13
13
  每份测试文件通过 `fileSetup` 创建独立 Agent,结束后释放。此模板连接一台设备或一个桌面,因此 Project 的 `maxConcurrentFiles` 固定为 1;提高此上限前,需要通过资源分配脚本为并发文件提供独立设备或桌面。
@@ -1,4 +1,3 @@
1
1
  node_modules/
2
2
  .env
3
3
  midscene_run/
4
- .midscene/test-results/
@@ -16,6 +16,6 @@ Run tests with `{{TEST_COMMAND}}`. Read `midscene-node-spec.ios.md` for the avai
16
16
 
17
17
  After changing Node registrations in `midscene.config.ts`, run `{{RUN_NODES_COMMAND}}` to refresh the spec. This loads the configuration without connecting to a device or running tests. Extension factories must only acquire runtime resources inside Node execution.
18
18
 
19
- Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and connections are released on failure. Reports are written to `midscene_run/report/`.
19
+ Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and connections are released on failure. Reports are written to `midscene_run/report/`; structured results and diagnostic records are saved in `midscene_run/test-results/<runId>/`. Set `MIDSCENE_RUN_DIR` to change the artifact root.
20
20
 
21
21
  Each test file creates its own Agent through `fileSetup` and releases it afterward. The Project is limited to one file at a time because this starter connects to a single device or desktop. Before increasing the Project limit, provide independent devices/displays through your resource allocator.
@@ -8,6 +8,6 @@
8
8
 
9
9
  启动 WebDriverAgent。可设置 `WDA_HOST` 和 `WDA_PORT`,或用 `WDA_BASE_URL` 指定带路径前缀的网关地址。远程 MJPEG 流可设置 `WDA_MJPEG_URL`,直连则可设置 `WDA_MJPEG_PORT`。`cases/todo.yaml` 打开在线 React TodoMVC,添加三个任务、删除一个、完成另一个、筛选已完成任务,并校验可见任务和未完成数量。设备需要能访问该网站;`beforeEach` 先执行 `midscene.config.ts` 中的 `todo.setup`,打开 All 视图并等待输入框加载,再由 `aiAssert` 确认列表为空(包含已完成任务)且没有遮挡弹窗。已有任务会保留;检查失败时,用例会在修改任务前停止。请切换到 All,删除全部任务(包括已完成任务),或仅清除 TodoMVC 网站的数据;关闭遮挡弹窗后重新运行。模型或连接异常应先按报告中的原因排查。AI 检查可能误判,失败时请结合报告确认页面状态。
10
10
 
11
- 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.ios.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并释放连接。报告位于 `midscene_run/report/`。
11
+ 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.ios.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并释放连接。报告位于 `midscene_run/report/`,结构化结果与诊断记录位于 `midscene_run/test-results/<runId>/`。可通过 `MIDSCENE_RUN_DIR` 修改产物根。
12
12
 
13
13
  每份测试文件通过 `fileSetup` 创建独立 Agent,结束后释放。此模板连接一台设备或一个桌面,因此 Project 的 `maxConcurrentFiles` 固定为 1;提高此上限前,需要通过资源分配脚本为并发文件提供独立设备或桌面。
@@ -1,4 +1,3 @@
1
1
  node_modules/
2
2
  .env
3
3
  midscene_run/
4
- .midscene/test-results/
@@ -16,7 +16,7 @@ Run tests with `{{TEST_COMMAND}}`. Read `midscene-node-spec.web.md` for the avai
16
16
 
17
17
  After changing Node registrations in `midscene.config.ts`, run `{{RUN_NODES_COMMAND}}` to refresh the spec. This loads the configuration without connecting to a device or running tests. Extension factories must only acquire runtime resources inside Node execution.
18
18
 
19
- Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and the browser is closed on failure. Reports are written to `midscene_run/report/`.
19
+ Tests run serially and stop after the first failed case (`test.bail: 1`). Reports are saved and the browser is closed on failure. Reports are written to `midscene_run/report/`; structured results and diagnostic records are saved in `midscene_run/test-results/<runId>/`. Set `MIDSCENE_RUN_DIR` to change the artifact root.
20
20
 
21
21
  ## How preparation works
22
22
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  `cases/todo.yaml` 使用在线 React TodoMVC。每条用例先由 `todo.setup` 打开 All 视图、清空页面存储并重新加载,通过 DOM 确认列表为空,再由 `todo.seed` 添加三个任务;第一条用例校验初始化状态,第二条用 AI 删除和完成任务,再校验最终状态。`todo.captureState` 在每条用例后记录页面状态。运行时需要能访问 TodoMVC 网站。
12
12
 
13
- 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.web.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并关闭浏览器。报告位于 `midscene_run/report/`。
13
+ 执行 `{{TEST_COMMAND}}` 运行测试。Node 列表见 `midscene-node-spec.web.md`;修改配置中的 Node 后执行 `{{RUN_NODES_COMMAND}}` 刷新。用例串行运行,首次失败即停止后续用例(`test.bail: 1`);失败时仍会保存报告并关闭浏览器。报告位于 `midscene_run/report/`,结构化结果与诊断记录位于 `midscene_run/test-results/<runId>/`。可通过 `MIDSCENE_RUN_DIR` 修改产物根。
14
14
 
15
15
  ## 准备工作如何执行
16
16
 
@@ -1,4 +1,3 @@
1
1
  node_modules/
2
2
  .env
3
3
  midscene_run/
4
- .midscene/test-results/
@@ -151,7 +151,7 @@ export declare interface ResolvedTestOptions {
151
151
  }
152
152
 
153
153
  export declare interface ResolvedTestOutputDefinition {
154
- reportDir: string;
154
+ reportDir?: string;
155
155
  reportFormat: 'single-html' | 'html-and-external-assets';
156
156
  }
157
157
 
@@ -194,6 +194,7 @@ export declare interface TestOptions {
194
194
  }
195
195
 
196
196
  export declare interface TestOutputDefinition {
197
+ /** Explicit report location, relative to the Test project. Defaults to report/ under the artifact root. */
197
198
  reportDir?: string;
198
199
  /** Defaults to a self-contained HTML; external assets require HTTP preview. */
199
200
  reportFormat?: 'single-html' | 'html-and-external-assets';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midscene/test",
3
3
  "description": "Midscene Test: an extensible YAML testing framework and Node SDK.",
4
- "version": "1.17.6",
4
+ "version": "1.17.7",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/web-infra-dev/midscene.git",
@@ -59,8 +59,8 @@
59
59
  "tsx": "^4.19.2",
60
60
  "yargs": "17.7.3",
61
61
  "zod": "^3.25.1",
62
- "@midscene/core": "1.17.6",
63
- "@midscene/shared": "1.17.6"
62
+ "@midscene/shared": "1.17.7",
63
+ "@midscene/core": "1.17.7"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@rslib/core": "^0.18.3",
@@ -72,20 +72,20 @@
72
72
  "puppeteer": "24.6.0",
73
73
  "typescript": "^5.8.3",
74
74
  "vitest": "3.0.5",
75
- "@midscene/android": "1.17.6",
76
- "@midscene/computer": "1.17.6",
77
- "@midscene/ios": "1.17.6",
78
- "@midscene/harmony": "1.17.6",
79
- "@midscene/web": "1.17.6"
75
+ "@midscene/android": "1.17.7",
76
+ "@midscene/harmony": "1.17.7",
77
+ "@midscene/ios": "1.17.7",
78
+ "@midscene/web": "1.17.7",
79
+ "@midscene/computer": "1.17.7"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "playwright": "^1.45.0",
83
83
  "puppeteer": "24.6.0",
84
- "@midscene/android": "1.17.6",
85
- "@midscene/computer": "1.17.6",
86
- "@midscene/ios": "1.17.6",
87
- "@midscene/web": "1.17.6",
88
- "@midscene/harmony": "1.17.6"
84
+ "@midscene/android": "1.17.7",
85
+ "@midscene/harmony": "1.17.7",
86
+ "@midscene/ios": "1.17.7",
87
+ "@midscene/computer": "1.17.7",
88
+ "@midscene/web": "1.17.7"
89
89
  },
90
90
  "peerDependenciesMeta": {
91
91
  "@midscene/android": {