Fix the UI tests. (#4085)

* Compile errors 😬

* Update server selection snapshots.

The default footer string has changed.

* Remove the TemplateScreen UI tests.

We use preview tests for snapshots now, UI tests are for flow coordinators.

* Add the same looping on the OIDC UI test (but disable the test in the end).

* Run UI tests separately for iPhone and iPad.

GitHub runners don't seem to have enough memory to handle 2 simulators at once.
This commit is contained in:
Doug
2025-05-02 12:47:31 +01:00
committed by GitHub
parent 5053a37eea
commit d47c802fec
16 changed files with 75 additions and 80 deletions
+24 -13
View File
@@ -105,17 +105,28 @@ lane :unit_tests do |options|
end
lane :ui_tests do |options|
create_simulator_if_necessary(
name: "iPhone-18.4",
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-16",
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-4"
)
# We used to run these simultaneously on iPhone and iPad but it is *really* slow on GitHub runners.
# Presumably because launching 2 simulators uses more memory than the runner has available.
create_simulator_if_necessary(
name: "iPad-18.4",
type: "com.apple.CoreSimulator.SimDeviceType.iPad-10th-generation",
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-4"
)
if options[:device] == "iPhone"
device = "iPhone-18.4"
create_simulator_if_necessary(
name: "iPhone-18.4",
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-16",
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-4"
)
elsif options[:device] == "iPad"
device = "iPad-18.4"
create_simulator_if_necessary(
name: "iPad-18.4",
type: "com.apple.CoreSimulator.SimDeviceType.iPad-10th-generation",
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-4"
)
else
UI.user_error!("Please supply a device argument as device:iPhone or device:iPad")
end
if options[:test_name]
test_to_run = ["UITests/#{options[:test_name]}"]
@@ -124,12 +135,12 @@ lane :ui_tests do |options|
end
reset_simulator = ENV.key?('CI')
run_tests(
scheme: "UITests",
devices: ["iPhone-18.4", "iPad-18.4"],
device: device,
ensure_devices_found: true,
prelaunch_simulator: true,
prelaunch_simulator: false,
result_bundle: true,
only_testing: test_to_run,
number_of_retries: 3,