Skip to content

fix: resolve fully-qualified native types in getByRole#196

Open
gmegidish wants to merge 1 commit into
mainfrom
fix/normalize-fully-qualified-native-types
Open

fix: resolve fully-qualified native types in getByRole#196
gmegidish wants to merge 1 commit into
mainfrom
fix/normalize-fully-qualified-native-types

Conversation

@gmegidish

Copy link
Copy Markdown
Member

No description provided.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1eb887a0-9e65-4cce-87d2-7d029e6d8c32

📥 Commits

Reviewing files that changed from the base of the PR and between 89aa112 and 6b9dd97.

📒 Files selected for processing (2)
  • packages/mobilewright-core/src/query-engine.test.ts
  • packages/mobilewright-core/src/query-engine.ts

Walkthrough

The role-matching logic in query-engine.ts gains a bareTypeName helper that normalizes platform-native type strings: it lowercases the value, extracts the last segment after any dot (stripping Android package prefixes like android.widget.), and removes the xcuielementtype prefix used by iOS. matchesRole is updated to pass node.type through this helper instead of calling .toLowerCase() directly. A new test suite adds queryAll assertions verifying that fully-qualified Android widget types and iOS XCUIElementType* strings resolve to their expected cross-platform roles.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Add a pull request description explaining the purpose of normalizing native type values and why this fix is necessary.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding logic to resolve fully-qualified native types in getByRole matching.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/normalize-fully-qualified-native-types

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed due to a network error.


Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant