feat: add HarmonyOS driver as standalone npm package (detox-driver-ha… - #4971
Open
RuiYangLian wants to merge 2 commits into
Open
RuiYangLian wants to merge 2 commits into
RuiYangLian wants to merge 2 commits into
Conversation
…rmony) External driver package for testing RNOH (React Native on HarmonyOS) apps with Detox. Uses Detox's built-in External driver mechanism — zero changes to Detox core (except 1-line bug fix in RuntimeDevice.js). Package: detox-driver-harmony/ - index.js: exports DeviceAllocationDriverClass, RuntimeDriverClass, ExpectClass - src/HDC.js: hdc CLI wrapper (install/launch/shell/rport/aa test) - src/HarmonyAllocDriver.js: device allocation via hdc list targets - src/HarmonyRuntimeDriver.js: runtime driver (install/launch/rport/screenshot) - src/HarmonyExpect.js: reuses Android AndroidExpect (same FQCN namespace) - README.md: full setup guide + API coverage Bug fix: RuntimeDevice.js passes newInstance flag to driver via baseLaunchArgs (was computed but not forwarded — HarmonyOS driver needs it for stop/restart cycle) Verified: 61/61 e2e tests pass on HarmonyOS 6.1.0 (API 23) real device. Signed-off-by: RuiYangLian <ruiyanglian6699@gmail.com> AI[94%] Human Fixed[0%] Human[6%] AI Adopted[100%] Co-authored-by: opencode (glm-5.2) <ai@local>
Author
|
Hi @noomorph 👋 The CI workflows need maintainer approval to run. Could you approve them when you have a moment? Happy to address any feedback. 🙏 |
…tJson + full runtime driver methods Port HarmonyOS fixes from gitcode fork (built-in driver) to the External driver package (detox-driver-harmony), achieving feature parity: Detox core (minimal, non-breaking): - Client.js: register detoxFetchLayout/detoxInjectGesture event callbacks + setFetchLayoutHandler/setGestureInjectHandler + injectLayoutJson method - actions.js: add InjectLayoutJson action class (isAtomic=false, timeout=0) External driver (detox-driver-harmony): - HarmonyRuntimeDriver.js: complete rewrite with all missing methods: setFetchLayoutHandler, setGestureInjectHandler, cleanup (pkill uitest), injectLayoutViaHdc, generateViewHierarchyXml, setURLBlacklist, disableSynchronization/enableSynchronization, takeScreenshot (uitest screenCap), tap/longPress, reverseTcpPort/unreverseTcpPort, testTimeout 300->150, installApp (param set persist.ace.testmode.enabled 1) - HDC.js: add fportRm for unreverseTcpPort Verified on Pura X (API 26): Meituan unified e2e 14/25->23/25, original 64-test suite 47/64->54/64. Signed-off-by: you_yang_ <lianruiyang@huawei.com> AI[64%] Human Fixed[0%] Human[36%] AI Adopted[100%]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds HarmonyOS (OpenHarmony) support as a standalone driver package (
detox-driver-harmony), using Detox's built-in External driver mechanism.RuntimeDevice.js: passnewInstanceflag to driver)