Tauri 运行测试套件
既然我们已经配置好了配置和规范,让我们来运行吧!
- npm
npm test
- Yarn
yarn test
我们应该会看到以下输出:
➜ webdriverio git:(main) ✗ yarn test
yarn run v1.22.11
$ wdio run wdio.conf.js
Execution of 1 workers started at 2021-08-17T08:06:10.279Z
[0-0] RUNNING in undefined - /test/specs/example.e2e.js
[0-0] PASSED in undefined - /test/specs/example.e2e.js
"spec" Reporter:
------------------------------------------------------------------
[wry 0.12.1 linux #0-0] Running: wry (v0.12.1) on linux
[wry 0.12.1 linux #0-0] Session ID: 81e0107b-4d38-4eed-9b10-ee80ca47bb83
[wry 0.12.1 linux #0-0]
[wry 0.12.1 linux #0-0] » /test/specs/example.e2e.js
[wry 0.12.1 linux #0-0] Hello Tauri
[wry 0.12.1 linux #0-0] ✓ should be cordial
[wry 0.12.1 linux #0-0] ✓ should be excited
[wry 0.12.1 linux #0-0] ✓ should be easy on the eyes
[wry 0.12.1 linux #0-0]
[wry 0.12.1 linux #0-0] 3 passing (244ms)
Spec Files: 1 passed, 1 total (100% completed) in 00:00:01
Done in 1.98s.
我们看到规范报告器告诉我们,来自`test/specs/example.e2e.js`文件的所有3个测试以及最终报告`Spec Files: 1 passed, 1 total (100% completed) in 00:00:01`。
使用WebdriverIO测试套件,我们只需通过几行配置和一个运行命令,就轻松为我们的Tauri应用程序启用了端到端测试!更好的是,我们根本不需要修改应用程序。