test(web-ui): expose stable DOM locators for OH UI automation - #1295
Merged
Conversation
Add stable data-testid coverage for app shell, welcome, navigation, session, agents, and skills surfaces, and document the locator planning and naming rules.
Add stable data-testid and data-* attributes for agent, skill, shell, browser, and terminal UI automation. Update UI test id documentation in English and Chinese.
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.
Summary
Add stable
data-testidanddata-*coverage across the Web UI so OH UI automation can target real interactive elements instead of relying on class names, DOM structure, or localized text.This PR mainly covers:
It also ports the locator set onto the current
gcwing/mainUI structure and resolves upstream merge conflicts without changing the intended product workflows.Type and Areas
Type:
test / UI automation / UI/UX / integration
Areas:
web UI, Flow Chat, Settings, navigation, shell/terminal, agents/skills
Motivation / Impact
Our OH automation stack drives BitFun through ArkWeb DevTools / CDP and depends on stable DOM locators. Before this change, several important paths still depended on brittle selectors such as class names, structure-only traversal, or visible text.
This PR makes the following flows much more stable:
Most changes are locator exposure only. A small number of wrapper nodes, prop passthroughs, and read-only
data-*state attributes were added where needed to anchor the real rendered or clickable node without changing the underlying product behavior.Verification
pnpm run type-check:web
pnpm run lint:web
Reviewer Notes
This PR is focused on stable UI automation locators and state attributes for OH E2E coverage.
It does not intentionally change tool execution, session flow, model behavior, persistence logic, or backend business logic. Where the current UI structure on
gcwing/maindiffered from the original branch, the integration kept upstream behavior and only re-applied the locator layer.One MiniApp result parsing change was narrowed before finalizing the branch so the UI no longer adds extra front-end normalization beyond direct string file lists and the existing fallback path.
AI-assisted: yes. Testing level: focused Web UI lint and type-check.
Checklist