Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find by AccessibilityIdentifier #77

Open
gmcadosch opened this issue Jan 25, 2022 · 3 comments
Open

Find by AccessibilityIdentifier #77

gmcadosch opened this issue Jan 25, 2022 · 3 comments

Comments

@gmcadosch
Copy link

There's a find(viewWithId:) function, but as I already set the accessibilityIdentifier property on all views for UI testing, I needed a new find function. I implemented this as a shortcut:

extension InspectableView {
func find(_ id: String) throws -> InspectableView<ViewType.ClassifiedView> {
try find { try $0.accessibilityIdentifier() == id }
}
}

Would be nice to see something like this integrated into the standard package as probably everyone doing UI testing already has those identifiers set.

@nalexn
Copy link
Owner

nalexn commented Jan 25, 2022

Hey, feel free to open a PR for that, great idea!

@nalexn
Copy link
Owner

nalexn commented Jan 25, 2022

I'd only picked a more verbose name for func find(_ id: String) to not be confused with other modifiers, including find(viewWithId:).

Maybe find(viewWithAccessibilityId:) ?

@gmcadosch
Copy link
Author

gmcadosch commented Jan 25, 2022 via email

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

No branches or pull requests

2 participants