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

[DON-491] Update search modal to fix the test automation #1958

Merged
merged 4 commits into from
May 8, 2024

Conversation

novinfard-skyscanner
Copy link
Contributor

[DON-491]
Update search modal to fix the test automation

Remember to include the following changes:

If you are curious about how we review, please read through the code review guidelines

@@ -74,7 +75,6 @@ public struct BPKAppSearchModal: View {
.padding(.top, .base)
.padding(.bottom, BPKSpacing.none)
.background(.surfaceDefaultColor)
.accessibilityAddTraits(.isModal)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The child views could not be accessed by identifier, blocking it for test automation.

Before After
Screenshot 2024-05-06 at 14 41 34 Screenshot 2024-05-06 at 15 33 08

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work for screen readers after this change. Is the focus properly 'trapped' in the view once it's open?

I assume it is because we present it with a .sheet{ } modifier, but could you double check please?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gert-janvercauteren There is no change for the current configuration of how our screens are placed in navigation structure. This modifier is responsible for preventing any undesirable screen readings of elements on the same level as the modal screen. It's still weird how Maestro reads the hierarchy here, and it seems like a small bug to me. However, it's completely fine to remove this modifier here, as it's not anything mandatory, it was just preventative.

Also, I additionally checked that with the accessibility inspector and there is no changes here.

@@ -65,6 +65,7 @@ public struct BPKSearchInputSummary: View {
.focused($focused)
.accessibilityAddTraits(.isSearchField)
.accessibilityLabel(placeholder)
.accessibilityIdentifier("search_field")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the automated test accessible in different localisation.

@novinfard-skyscanner novinfard-skyscanner marked this pull request as ready for review May 6, 2024 18:23
Copy link
Contributor

@gert-janvercauteren gert-janvercauteren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Cherry on top would be a note in the README on UI-testing, so everyone is aware we can now use the search_field identifier when using this component. @novinfard-skyscanner would you be up for adding that before merging?

@LewisI224 LewisI224 merged commit d53ff06 into main May 8, 2024
14 checks passed
@LewisI224 LewisI224 deleted the donburi/DON-491-update-search-modal-for-automation branch May 8, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bpk minor Non breaking change swiftui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants