Skip to content

sqlab-sustech/HarmonyOS-App-Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HarmonyOS-App-Test

This repository contains the artifacts related to model-based GUI testing for HarmonyOS apps.

Document

Setup

To run this project, you need the environment as follows.

Hardware

  • Operating System: windows 10 64-bit or windows 11 64-bit
  • Memory: 16 GB RAM or higher
  • Storage: 100 GB free space or more
  • Display Resolution: 1280x800 pixels or higher

Software

  • Python: preferably version 3.x
  • Node.js: version 16.x or higher recommended
  • DevEco Studio: version 3.1 or 4.0 (You can install version 3.1 by deveco-studio-3.1.0.501.exe provided in this project.)

Usage

Clone the project.

git clone https://github.com/sqlab-sustech/HarmonyOS-App-Test.git

Enter the project folder and install the necessary third-party Node.js libraries.

cd HarmonyOS-App-Test
npm install

Modify the value of project variable in script.py to the folder path of the HarmonyOS app you would like to test on.

Then run script.py.

python script.py

This will generate PTG.json, which represents page transition graph extracted from the HarmonyOS app project by static analysis. Open the HarmonyOS app project using DevEco Studio, such as https://github.com/WinWang/HarmoneyOpenEye project listed in project.txt. Copy the content in PTG.json to PTGJson variable in PTG.ets. Then copy Ability.test.ets and PTG.ets to the src/ohosTest/ets/test folder in the HarmonyOS app project.

You can choose random strategy or model-based strategy to run with. Create a Huawei Phone Emulator in DevEco Studio. Open the phone, set the total testing time and run Ability.test.ets with coverage. Finally you will get a .test folder including coverage information of testing.

image

Demo

The demo video for this project is available at Model-based GUI Testing For HarmonyOS Apps.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published