harmonyos-autotest

Convert Chinese HarmonyOS UI requirements into executable Hypium test cases.

31|6|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill harmonyos-autotest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: harmonyos-autotest
Source: https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/harmonyos-autotest
Command: npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill harmonyos-autotest

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

When you describe HarmonyOS app testing steps in natural language, you still need to manually convert them into executable Hypium test code and repeatedly fix failures due to locator mismatches and environment issues.

Core Features & Use Cases

  • Natural language → Hypium test code: Parses Chinese test steps into structured JSON and generates executable Hypium Python test cases.
  • Step-by-step debugging with strict guardrails: Runs each test step in isolation, requires user confirmation, and comments out confirmed steps to prevent drift.
  • Robust UI control locating: Exports the device control tree, prioritizes locator strategies (text/type/key/id), and falls back to screenshot + AI image analysis when control-tree targeting fails.
  • Environment detection + project scaffolding: Checks HDC/Hypium/device availability, then creates a ready-to-run Hypium test project from a template and produces reports (HTML/XML/JSON).

Use case example: You want to test that a settings page search and UI toggles work. Write steps in Chinese, let this Skill generate the Hypium test project, debug each step until controls are reliably found, then run an end-to-end execution to produce a full test report.

Quick Start

Run the harmonyos-autotest skill with your test steps markdown file to generate and debug a runnable Hypium automation test project for your HarmonyOS app.

Frequently Asked Questions about harmonyos-autotest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Chinese test steps into runnable Hypium test cases for HarmonyOS?

To convert Chinese test steps into Hypium test cases, parse natural-language requirements into structured JSON and generate executable Python test code for HarmonyOS UI automation. This parses your markdown steps and scaffolds a ready-to-run project.

Do I need HDC and Hypium runtime installed to generate HarmonyOS UI tests?

Yes, HDC and Hypium runtime are required to generate and execute HarmonyOS UI tests. The automation workflow checks HDC, Hypium, and device availability before creating a test project template to ensure deterministic device operations.

What is the best way to locate UI controls when HarmonyOS test automation fails?

The best way to locate UI controls in HarmonyOS test automation is prioritizing text, type, key, and ID strategies from the exported control tree. When control-tree targeting fails, it falls back to screenshot and AI image analysis.

How does step-by-step debugging work for HarmonyOS Hypium test cases?

Step-by-step debugging for Hypium test cases runs each action in isolation and requires user confirmation before proceeding. Confirmed steps are commented out to prevent drift, ensuring reliable end-to-end execution and structured test report generation.

Can I use natural language to automate settings page search and UI toggle testing on HarmonyOS?

Yes, you can use natural language to automate settings page search and UI toggle testing on HarmonyOS. Write steps in Chinese, generate a Hypium project, debug control locators step-by-step, and run end-to-end to produce HTML, XML, or JSON reports.

Why does my HarmonyOS UI test fail due to environment or locator mismatch issues?

HarmonyOS UI tests fail due to environment or locator mismatch issues when HDC, Hypium, or device availability is unverified, or when control-tree targeting fails. Strict single-step execution and screenshot AI fallback help resolve these mismatches.