Skip to content

Additional UI tests / also disabling animations to speed up UI tests#3994

Merged
wmathurin merged 9 commits intoforcedotcom:devfrom
wmathurin:simpler_ui_test_config
Feb 27, 2026
Merged

Additional UI tests / also disabling animations to speed up UI tests#3994
wmathurin merged 9 commits intoforcedotcom:devfrom
wmathurin:simpler_ui_test_config

Conversation

@wmathurin
Copy link
Contributor

@wmathurin wmathurin commented Feb 24, 2026

Overview

  • A number of scenarios described in the 13.2 high level test plans were not covered.
  • Converted test scheme to test plans

Test scenarios described in this Salesforce internal doc

- MigrationTests
- LoginWithRestartTests
- MultiUserLoginTests
- RefreshTokenMigrationTests
Copy link
Contributor Author

Choose a reason for hiding this comment

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

More descriptive name


// Speed up UI tests by disabling animations
if ProcessInfo.processInfo.arguments.contains("-UITesting") {
UIView.setAnimationsEnabled(false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not new - was in a separate suite previously.

@@ -1,8 +1,8 @@
/*
DynamicConfigLoginTests.swift
LoginWithRestartTests.swift
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a new test - but was in our high level test plan.

logout()
}

// MARK: - Beacon and Non-Beacon Multi-User
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New tests

///
/// NB: Tests use the third and fourth user from ui_test_config.json
///
class RefreshTokenMigrationWithRestartTests: BaseAuthFlowTester {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New tests - maybe overkill??

@wmathurin wmathurin changed the title Additional UI. tests / also disabling animations to speed up UI tests Additional UI tests / also disabling animations to speed up UI tests Feb 24, 2026
@github-actions
Copy link

github-actions bot commented Feb 24, 2026

TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^18 Test Results591 ran590 ✅1 ❌
TestResult
SalesforceSDKCore iOS ^18 Test Results
DomainDiscoveryCoordinatorTests.testMissingMyDomain()❌ failure

@github-actions
Copy link

github-actions bot commented Feb 24, 2026

TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^26 Test Results591 ran590 ✅1 ❌
TestResult
SalesforceSDKCore iOS ^26 Test Results
DomainDiscoveryCoordinatorTests.testNonCallbackURL()❌ failure

@github-actions
Copy link

1 Warning
⚠️ Big PR, try to keep changes smaller if you can.

Generated by 🚫 Danger

@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 58.33333% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.82%. Comparing base (06e487f) to head (5abe185).
⚠️ Report is 10 commits behind head on dev.

Files with missing lines Patch % Lines
...ore/Classes/Login/DevConfig/BootConfigEditor.swift 58.33% 10 Missing ⚠️
...lasses/Login/DevConfig/DiscoveryResultEditor.swift 54.54% 10 Missing ⚠️
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     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 69.76% <ø> (ø)
Core 59.54% <58.33%> (-3.76%) ⬇️
SmartStore 74.70% <ø> (+0.11%) ⬆️
MobileSync 87.41% <ø> (-0.12%) ⬇️
Files with missing lines Coverage Δ
...s/Login/DevConfig/LoginOptionsViewController.swift 98.70% <100.00%> (ø)
...ore/Classes/Login/DevConfig/BootConfigEditor.swift 59.40% <58.33%> (-37.47%) ⬇️
...lasses/Login/DevConfig/DiscoveryResultEditor.swift 64.51% <54.54%> (-6.28%) ⬇️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…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 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

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
@wmathurin
Copy link
Contributor Author

Ran it locally (from the command line) and got all the tests to pass. It took 39 minutes.
Screenshot 2026-02-25 at 8 44 31 PM

@wmathurin wmathurin marked this pull request as ready for review February 26, 2026 04:45
@wmathurin wmathurin requested a review from bbirman February 26, 2026 21:34
"locationScenario" : {
"identifier" : "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
},
"maximumTestExecutionTimeAllowance" : 360,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test will be killed if taking more than 6'

},
"testExecutionOrdering" : "random",
"testRepetitionMode" : "retryOnFailure",
"maximumTestRepetitions" : 3,
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 retry has allowed me to get all tests to pass locally from a single invocation of xcodebuild test.

},
"testTargets" : [
{
"parallelizable" : true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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"
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 screenshots are really useful to see what happened. Not sure if there will be an easy way to get them on CI.

@wmathurin wmathurin merged commit 1815820 into forcedotcom:dev Feb 27, 2026
20 of 29 checks passed
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

Successfully merging this pull request may close these issues.

2 participants