Convert UI tests screens to be ScreenObject subclasses – Part 4 of many#17360
Convert UI tests screens to be ScreenObject subclasses – Part 4 of many#17360
ScreenObject subclasses – Part 4 of many#17360Conversation
|
You can trigger an installable build for these changes by visiting CircleCI here. |
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
1e271fc to
a7206d0
Compare
ScreenObject subclasses – Part 4 of many
a7206d0 to
2608300
Compare
| if !element.isFullyVisibleOnScreen { | ||
| XCTFail("Unable to scroll element into view") | ||
| } | ||
| element.scrollIntoView(within: scrollView, threshold: threshold) |
There was a problem hiding this comment.
You might notice that this code is part of BaseScreen, which this train of work aims to remove.
This change here moved the logic to a dedicated extension (feb932e) so that both BaseScreen and ScreenObject could share it in the context of this project.
Better than copy-pasting, in particular because this code is fit to live in the XCUITestHelpers project.
This is so that `BaseScreen` and `ScreenObject` can share it.
2608300 to
a3a3c03
Compare
|
Not a part of this PR: it looks like switching to Xcode 13 (and iOS 15) slows down the tests dramatically. Latest execution while still using Xcode 12.5.1 took 557 seconds, while the next already using Xcode 13.0 takes 956 😢 . On the surface it looks like there's an extra delay between all events (key presses, taps, assertions). This is what I mean (my local Xcode 13.1 + iOS 15): Screen.Recording.2021-11-15.at.17.40.00.movI'm installing Simulator 14.5 (which was lost during update) to see if the slowness is related to Xcode or to iOS version. |
|
Using Xcode 13.1 in combination with iOS 14.5 solves the speed issue. I found the similar report here (it's an Appium repo, but the root cause is in XCTest). According to one comment from there, the issue also gets fixed in iOS 15.2 (available with code 13.2 which is still beta). |
|
Thanks @pachlava! I might try Xcode 13.2 beta and see how it compares 🤞 |

See #17221, #17348, and #17359.
I made this on top of #17359 for ease of review.
Regression Notes
Potential unintended areas of impact
N.A.
What I did to test those areas of impact (or what existing automated tests I relied on)
N.A.
What automated tests I added (or what prevented me from doing so)
N.A.
RELEASE-NOTES.txtif necessary. N.A.