|
My UI Test code:
ERROR: Failed to get matching snapshot: No matches found for Elements matching predicate '"NEW PROJECT" IN identifiers' from input {( Button, label: 'Home', Button, label: 'Open', Selected, Button, label: 'Closed', Button, label: 'Awards', Button, label: 'Sort', Button, label: 'Add Project', Button, label: 'Add New Item', Button, label: 'Compose' )} I assume since the only button I cannot identify is [label: 'Compose'] that this must be the issue? This is likely the "Edit Project" button. I tried using "Compose" in place of "NEW PROJECT" but that did not work either. I tried it as both a button and a label. My UI definitely has the words "NEW PROJECT" along with the "square.and.pencil" image to the right of the project name. Any ideas? Thanks in advance! Brad K. |
|
Or is this possibly a bug in Xcode Version 13.0 beta 4 (13A5201i) using Build Setting of iOS 14.7 running on Big Sur 11.4? |
|
hey @bradkimbrell, I'm having a similar issue to what you had by the sounds of it. I was able to make the test work using "Compose" but then the updated project name isn't recognised. Did you manage to find out where you were going wrong? |
|
I'm not sure when this UI test was broken and whether it is only due to iOS 15 or whether it is caused by the accessibility enhancements we have added to the project. Basically we can say the button which is triggering the transition to
This ensures that VoiceOver knows that this button is about editing a project instead of "Compose" (whatever this would mean otherwise). Further it is using the translated names from the To fix the UI test, you can then add a tap onto the See my changes in my version of the app. EDIT: I've just tried to run the original UI test version (which did run 4 months ago) on an iOS 14.5 Simulator... and they were mostly broken: the buttons containing symbols/labels do not have proper label to identify them during the UI tests:
I've no idea how somebody runs regular UI tests with this broken system... Luckily it works again on iOS 15 EDIT 2: I've now analyzed more in detail why the UI tests broke on iOS 14.5 and I've fixed my UI tests in another change. The problems were twofold:
In my solution, I'm now using the In the end, my UI tests work again. :-) |
|
For Xcode 13.3.1 and a Simulator running iOS 15.4, I found this gets the test to work:
A couple of things to note:
|
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.