haptest
v0.1.6
Published
HapTest is an OpenHarmony application UI automated testing framework.
Downloads
144
Readme
HapTest
Description
HapTest is an OpenHarmony application UI automated testing framework. It supports a variety of testing strategies and can effectively automate UI testing, thereby improving the stability and quality of applications.
Installation
npm install haptest
Build
Install dependencies
npm i
Build & Pack
npm run build
npm pack
Instructions
1. Usage
haptest [options]
Options:
-V, --version output the version number
-i --hap <file/bundleName/sourceRoot> HAP bundle name or HAP file path or HAP project source root
-o --output <dir> output dir (default: "out")
--policy <policyName> policy name (default: "manu")
-t --target [connectkey] hdc connectkey
-c --coverage enable coverage (default: false)
-h, --help display help for command
2. Using DevEco simulator to run HAP
- download DevEco: https://developer.huawei.com/consumer/cn/deveco-studio/
- Refer to the link to run the emulator: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-run-emulator-0000001582636200-V5
- test HAP photos
haptest -i com.huawei.hmos.photos -o out
3. Build & Test your Hap Build Hap & Instrument coverage
- download Command Line Tools: https://developer.huawei.com/consumer/cn/download/
- add ${command-line-tools}/bin to PATH
- using haptest cmd to build instrument and test your Hap.
haptest -i {Hap project root } --policy greedy_dfs -o out
Contribution
- Fork the repository
- Create Feat_xxx branch
- Commit your code
- Create Pull Request