Repository navigation
Keep AccessibilitySnapshot out of the Prefire package - #200
Merged
Merged
Conversation
PrefireVoiceOver depended on AccessibilitySnapshotParser, so every Prefire consumer resolved AccessibilitySnapshot, iOSSnapshotTestCase and swift-snapshot-testing, and anyone pinned below 0.13 could not update. PrefireVoiceOver now has no dependencies besides Prefire. It takes the parsed elements through `voiceOverTranscript(elements:timeout:accessibilityImage:)`, and the generated tests map AccessibilityHierarchyParser in a private `voiceOverElements(in:)`, so the parser stays a dependency of the test target at the version it pins. PrefireSnapshotTests compiles and runs that generated code against the real parser.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c71852378
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Built with `make binary` from this branch: universal arm64 and x86_64, macOS 13 minimum, no absolute build paths.
…age parity The Trip references were recorded on iOS 27, while .prefire.yml requires iOS 26, where SF Symbols are read by their names. They are re-recorded on iOS 26.3, through the plugin with the rebuilt CLI. New tests check that an accessibility image taken next to the text is the same as one taken alone, so turning text on keeps existing -accessibility references, and that generic app views and hosting views are classified by their image. Comments and docs now say that [] and an empty value turn VoiceOver snapshots off, and that text references depend on the simulator's language like the images do.
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.
Short description 📝
Follow-up to #199.
PrefireVoiceOverno longer depends on AccessibilitySnapshot, so the rootPackage.swifthas no external dependencies again.With the package-level dependency, every Prefire consumer resolved AccessibilitySnapshot, iOSSnapshotTestCase and swift-snapshot-testing, even if they only use
Prefire, and anyone pinned to AccessibilitySnapshot below 0.13 couldn't update Prefire.Solution 📦
PrefireVoiceOverdepends only onPrefire. It keeps the formatter, hosting, polling and automation setup.The public entry point takes the parsed elements:
capture.voiceOverTranscript(elements:timeout:accessibilityImage:).VoiceOverTranscript.Element,CustomContentandCustomRotorare public so callers can build them.The generated tests map
AccessibilityHierarchyParserin a privatevoiceOverElements(in:)and importAccessibilitySnapshotParsernext toPrefireVoiceOver. The parser is a dependency of the user's test target, at the version they pin. A missing parser is a compile error, like a missingPrefireVoiceOver.CI still compiles and runs this glue against the real parser:
VoiceOverConsumer.generated.swiftis regenerated from the template (checked byVoiceOverTemplateTests) and runs inPrefireSnapshotTests, which already depends on AccessibilitySnapshot.Example: the SPM manifest adds
AccessibilitySnapshotParserto the test target, the Xcode project requires AccessibilitySnapshot 0.13+.Docs:
Configuration.mdandTemplates.mddescribe the new setup.Bundled CLI rebuilt with
make binaryfrom this branch (universal, macOS 13 minimum, no absolute build paths), so the plugin generates the new call.Example: the four
Triptext references were recorded on iOS 27, but.prefire.ymlrequires iOS 26, where SF Symbols are read by name (suitcase.rolling.fill. Image.). Re-recorded on iOS 26.3 through the plugin with the rebuilt CLI.New tests: an accessibility image taken next to the text is byte-identical to one taken alone (turning
texton keeps existing-accessibilityreferences); generic app views are named and hosting views are not.Comments and docs:
[]and an empty value turn VoiceOver snapshots off; text references depend on the simulator's language, like the images.Testing
swift test(root)make testmake test-iosswift package show-dependencies(root)UIKitVoiceOverTestspasses; all text references match. Image tests fail only because the Example commits no PNG references, as before.