Add HarmonyOS (OpenHarmony) platform support — 61/61 e2e verified
Author: RuiYangLianCreated Aug 11, 2026Updated Aug 13, 2026
Labelstype: enhancement ⚡️status: triage
Describe your idea
Summary
We've implemented HarmonyOS support for Detox, enabling RNOH (React Native on HarmonyOS) apps to be tested with the same Detox API as iOS and Android. 61/61 e2e tests pass on a real HarmonyOS device.
Why
HarmonyOS is growing rapidly in the mobile market. RNOH (@react-native-oh/react-native-harmony) brings React Native to HarmonyOS, but there's no E2E testing framework for it yet. Developers have to use black-box tools (Appium) or manual testing, losing Detox's gray-box sync advantage.
What we built
A device-side native client in ArkTS that:
- Connects to DetoxServer via WebSocket (same as iOS
Detox.framework/ AndroidDetoxActionExecutor) - Reuses the same Android FQCN namespace (
com.wix.detox.espresso.*) — zero changes to Detox JS source - Uses
@kit.TestKit(HarmonyOS built-in UI testing API) forfindComponent/click/scroll/dumpLayout - Implements gray-box sync via C++ JSI probes (main thread / JS thread / animation / layout / timer / network idle detection) — no dependency on accessibility service
Test code is 100% identical across platforms:
await element(by.id('login-btn')).tap();
await expect(element(by.text('Welcome'))).toBeVisible();Verification
- 61/61 e2e tests pass (matchers, actions, expectations, waits, device ops, gray-box sync)
- API coverage: P0 100%, P1 ~90%
- Real device: HarmonyOS 6.1.0, API 23 What's in the PR
- detox/openHarmony/ — ArkTS native client (HAR)
- detox/src/ — JS-side wiring (device factory, runtime driver, HDC wrapper, matchers, expect)
- examples/demo-react-native-harmony/ — demo app + 9 e2e test suites + README
- Full fork: https://gitcode.com/react-native/detox
Source: wix/Detox