mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Fix missing UI tests simulator (#860)
* Fix UI and integration tests missing simulators (older) * Update fastlane and dependencies
This commit is contained in:
+28
-1
@@ -109,7 +109,12 @@ lane :unit_tests do
|
||||
)
|
||||
end
|
||||
|
||||
lane :ui_tests do
|
||||
lane :ui_tests do
|
||||
create_simulator_if_necessary(
|
||||
name: "iPad (9th generation)",
|
||||
type: "com.apple.CoreSimulator.SimDeviceType.iPad-9th-generation"
|
||||
)
|
||||
|
||||
run_tests(
|
||||
scheme: "UITests",
|
||||
devices: ["iPhone 14", "iPad (9th generation)"],
|
||||
@@ -128,6 +133,11 @@ lane :ui_tests do
|
||||
end
|
||||
|
||||
lane :integration_tests do
|
||||
create_simulator_if_necessary(
|
||||
name: "iPhone 13 Pro",
|
||||
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-13-Pro"
|
||||
)
|
||||
|
||||
run_tests(
|
||||
scheme: "IntegrationTests",
|
||||
devices: ["iPhone 13 Pro"],
|
||||
@@ -330,3 +340,20 @@ private_lane :update_app_icon do |options|
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private_lane :create_simulator_if_necessary do |options|
|
||||
simulator_name = options[:name]
|
||||
UI.user_error!("Invalid simulator name") unless !simulator_name.to_s.empty?
|
||||
|
||||
simulator_type = options[:type]
|
||||
UI.user_error!("Invalid simulator type") unless !simulator_type.to_s.empty?
|
||||
|
||||
|
||||
# Use use a `(` here to avoid matching `iPhone 13 Pro` on `iPhone 13 Pro Max` for example
|
||||
begin sh("xcrun simctl list devices | grep '#{simulator_name} ('")
|
||||
UI.success "Simulator already exists"
|
||||
rescue
|
||||
sh("xcrun simctl create '#{simulator_name}' #{simulator_type}")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user