Additional UI tests / also disabling animations to speed up UI tests#3994
Additional UI tests / also disabling animations to speed up UI tests#3994wmathurin merged 9 commits intoforcedotcom:devfrom
Conversation
| - MigrationTests | ||
| - LoginWithRestartTests | ||
| - MultiUserLoginTests | ||
| - RefreshTokenMigrationTests |
There was a problem hiding this comment.
More descriptive name
|
|
||
| // Speed up UI tests by disabling animations | ||
| if ProcessInfo.processInfo.arguments.contains("-UITesting") { | ||
| UIView.setAnimationsEnabled(false) |
There was a problem hiding this comment.
It seems to be a bit faster (~20% faster).
| /// This class runs the same tests as BeaconLoginTests but uses the advanced_auth login host. | ||
| /// | ||
| /// NB: Tests use the first user from ui_test_config.json (advanced_auth host) | ||
| /// NB: Tests use the second user from ui_test_config.json (advanced_auth host) |
There was a problem hiding this comment.
Since we have more than 5 test suites and they run in parallel, we don't want the same user logging in more than 5 times at once.
|
|
||
| // MARK: - CA Non-hybrid Web Server Flow Tests | ||
|
|
||
| /// Login with CA opaque using default scopes and (non-hybrid) web server flow. |
There was a problem hiding this comment.
Not new - was in a separate suite previously.
| @@ -1,8 +1,8 @@ | |||
| /* | |||
| DynamicConfigLoginTests.swift | |||
| LoginWithRestartTests.swift | |||
There was a problem hiding this comment.
Focus of the class is tests that involve restart - they mostly deal with dynamic config since it is defined in memory only.
|
|
||
| // MARK: - Multi-User Restart | ||
|
|
||
| /// Login multiple users with dynamic config, restart app, and verify all users persist correctly. |
There was a problem hiding this comment.
That's a new test - but was in our high level test plan.
| logout() | ||
| } | ||
|
|
||
| // MARK: - Beacon and Non-Beacon Multi-User |
| /// | ||
| /// NB: Tests use the third and fourth user from ui_test_config.json | ||
| /// | ||
| class RefreshTokenMigrationWithRestartTests: BaseAuthFlowTester { |
There was a problem hiding this comment.
New tests - maybe overkill??
|
||||||||||||||||
|
||||||||||||||||
Generated by 🚫 Danger |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #3994 +/- ##
==========================================
- Coverage 69.27% 66.82% -2.45%
==========================================
Files 253 254 +1
Lines 22260 22408 +148
==========================================
- Hits 15421 14975 -446
- Misses 6839 7433 +594
🚀 New features to boost your workflow:
|
…simulated discovery results) -> saving on a few taps
…ng with simulated discovery results) -> saving on a few taps" This reverts commit f74afc8.
…ert - that saves a bit of time Unfortunately, we have to deal with the "Allow Paste" permission pop-up Also converted test scheme to use test plan
| let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") | ||
| let semaphore = DispatchSemaphore(value: 0) | ||
|
|
||
| DispatchQueue.global().async { |
There was a problem hiding this comment.
Ugly code to handle the paste permission alert.
One of the reason I migrated the test scheme to use a test plan is because I thought the paste permission could be granted there.
Also I tried to make it work on export too but couldn't get the alert to dismiss properly.
…le tests in parallel
Saving a few taps here and there.
Locally running the command gets 59/65 to pass (last 6 pass if retried in xcode) and take 1700s
| "locationScenario" : { | ||
| "identifier" : "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier" | ||
| }, | ||
| "maximumTestExecutionTimeAllowance" : 360, |
There was a problem hiding this comment.
Test will be killed if taking more than 6'
| }, | ||
| "testExecutionOrdering" : "random", | ||
| "testRepetitionMode" : "retryOnFailure", | ||
| "maximumTestRepetitions" : 3, |
There was a problem hiding this comment.
The retry has allowed me to get all tests to pass locally from a single invocation of xcodebuild test.
| }, | ||
| "testTargets" : [ | ||
| { | ||
| "parallelizable" : true, |
There was a problem hiding this comment.
Running test suites on different simulator (the number depends on the capability of the machine I think). Locally I get all the tests to complete in under 40 minutes.
| "testRepetitionMode" : "retryOnFailure", | ||
| "maximumTestRepetitions" : 3, | ||
| "testTimeoutsEnabled" : true, | ||
| "uiTestingScreenshotsLifetime" : "deleteOnSuccess" |
There was a problem hiding this comment.
The screenshots are really useful to see what happened. Not sure if there will be an easy way to get them on CI.

Overview
Test scenarios described in this Salesforce internal doc