feat(cli): nativeproof inspect — selector discovery for the current screen#74
Merged
Conversation
…creen Selector discovery (issue #23, step 2): nativeproof inspect starts a session with the configured project (noReset), reads the page source, and prints the candidate native.* locators a spec author would write — semantic roles with accessible names first, then visible text (the same alternation getByText matches), then test ids. Kills the read-the-XML-and-guess authoring loop. The extraction is a pure, tested function (src/inspect.ts); session capabilities are shared with the runner via projectCapabilities(). Device-proven against a live Android 15 Settings screen (docs/proof/inspect/).
8fdd06f to
9c3bcf8
Compare
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
nativeproof inspect(with--ios/--android/--projectselection) starts a session with the configured project (noResetso app state survives), reads the current page source, and prints the candidatenative.*locators a spec author would write — semantic roles with accessible names first, then every visible text (the exact alternationgetByTextmatches), then test ids. The authoring-time counterpart of the did-you-mean failure hint: nobody reads XML and guesses strings.selectorSuggestionsinsrc/inspect.ts); values are decoded, deduplicated, capped at 60 chars, and iOSnames that merely mirror the label are dropped. Session capabilities are shared with the runner via a newprojectCapabilities()(pure refactor ofbuildWdioConfig's spread).Proof
npm run checkfeat/inspect.npm testparseArgs/help wiring).Device proof ran:
nativeproof inspect --androidagainst a live Android 15 emulator on the Settings home screen printed 41 candidate locators; the verbatim output is committed atdocs/proof/inspect/android-settings-inspect.log. Sample:Screenshots: Not applicable; the deliverable is terminal text, committed verbatim as the log above.
Risk
projectCapabilities()frombuildWdioConfig(same spread, covered by existing config tests).Notes
PR Proof Law
.agents/DEFINITION_OF_DONE.mdand.agents/skills/pr-inline-screenshot-proof/SKILL.md., or the proof section saysNot applicablewith the technical reason.