33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
# File 'lib/fastlane/plugin/saucectl/actions/sauce_config_action.rb', line 33
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :platform,
description: "application under test platform (ios or android)",
optional: false,
type: String,
verify_block: proc do |value|
UI.user_error!(@messages['platform_error']) if value.to_s.empty?
end),
FastlaneCore::ConfigItem.new(key: :kind,
description: "Specifies which framework is associated with the automation tests configured in this specification (xcuitest & espresso)",
optional: false,
type: String,
verify_block: proc do |value|
UI.user_error!(@messages['platform_error']) if value.to_s.empty?
end),
FastlaneCore::ConfigItem.new(key: :app,
description: "The path to the app",
optional: false,
type: String,
verify_block: proc do |value|
UI.user_error!(@messages['app_name_error']) unless value && !value.empty?
end),
FastlaneCore::ConfigItem.new(key: :test_app,
description: "The path to the testing app",
optional: false,
is_string: true,
verify_block: proc do |value|
UI.user_error!(@messages['test_runner_app_error']) unless value && !value.empty?
end),
FastlaneCore::ConfigItem.new(key: :region,
description: "Data Center region (us or eu), set using: region: 'eu'",
optional: false,
type: String,
verify_block: proc do |value|
UI.user_error!(@messages['region_error'].gsub!('$region', value)) unless @messages['supported_regions'].include?(value)
end),
FastlaneCore::ConfigItem.new(key: :retries,
description: "Sets the number of times to retry a failed suite",
optional: true,
type: Integer,
default_value: 0),
FastlaneCore::ConfigItem.new(key: :test_distribution,
description: "Test distribution method",
optional: true,
type: String),
FastlaneCore::ConfigItem.new(key: :test_class,
description: "Array of tests to execute",
optional: true,
type: Array),
FastlaneCore::ConfigItem.new(key: :size,
description: "Instructs saucectl to run only tests that are annotated with the matching size value i.e @SmallTest, @MediumTest or @LargeTest. Valid values are small, medium, or large. You may only specify one value for this property",
optional: true,
type: String),
FastlaneCore::ConfigItem.new(key: :annotation,
description: "Instructs saucectl to run only tests that match a custom annotation that you have set",
optional: true,
type: String),
FastlaneCore::ConfigItem.new(key: :emulators,
description: "The parent property that defines details for running this suite on virtual devices using an emulator",
optional: true,
type: Array,
verify_block: proc do |emulators|
emulators.each do |emulator|
if emulator.class != Hash
UI.user_error!("Each emulator must be represented by a Hash object, #{emulator.class} found")
end
verify_device_property(emulator, :name)
set_default_property(emulator, :orientation, 'portrait')
verify_device_property(emulator, :platform_versions)
end
end),
FastlaneCore::ConfigItem.new(key: :devices,
description: "The parent property that defines details for running this suite on real devices",
optional: true,
type: Array,
verify_block: proc do |devices|
devices.each do |device|
if device.class != Hash
UI.user_error!("Each device must be represented by a Hash object, #{device.class} found")
end
verify_optional_device_props(device)
set_default_property(device, :orientation, 'portrait')
set_default_property(device, :device_type, 'phone')
set_default_property(device, :private, true)
set_default_property(device, :carrier_connectivity, false)
end
end),
FastlaneCore::ConfigItem.new(key: :name,
description: "The name of the device or emulator",
optional: true,
type: String),
FastlaneCore::ConfigItem.new(key: :id,
description: "The id of the device",
optional: true,
type: String),
FastlaneCore::ConfigItem.new(key: :platform_versions,
description: "Platform versions of the virtual device you wish to test your application on: Virtual Device only",
optional: true,
type: Array),
FastlaneCore::ConfigItem.new(key: :platform_version,
description: "Platform version of the real device you wish to test your application on: Real device only",
optional: true,
type: String),
FastlaneCore::ConfigItem.new(key: :orientation,
description: "The orientation of the device. Default: portrait",
optional: true,
type: String,
default_value: 'portrait'),
FastlaneCore::ConfigItem.new(key: :device_type,
description: "Request that the matching device is a specific type of device. Valid values are: ANY TABLET PHONE any tablet phone",
optional: true,
type: String,
default_value: 'phone'),
FastlaneCore::ConfigItem.new(key: :private,
description: "Request that the matching device is from your organization's private pool",
optional: true,
is_string: false),
FastlaneCore::ConfigItem.new(key: :carrier_connectivity,
description: "Request that the matching device is also connected to a cellular network",
optional: true,
is_string: false),
FastlaneCore::ConfigItem.new(key: :test_target,
description: "Name of the Xcode test target name",
optional: true,
type: String),
FastlaneCore::ConfigItem.new(key: :test_plan,
description: "Name of the Xcode test plan",
optional: true,
type: String),
FastlaneCore::ConfigItem.new(key: :path_to_tests,
description: "Path to your espresso tests",
optional: true,
type: String),
FastlaneCore::ConfigItem.new(key: :clear_data,
description: "Clear package data from device (android only)",
optional: true,
is_string: false,
default_value: true),
FastlaneCore::ConfigItem.new(key: :use_test_orchestrator,
description: "User Android test orchestrator (android only)",
optional: true,
is_string: false,
default_value: true),
FastlaneCore::ConfigItem.new(key: :max_concurrency_size,
description: "Sets the maximum number of suites to execute at the same time. If the test defines more suites than the max, excess suites are queued and run in order as each suite completes",
optional: true,
type: Integer,
default_value: 1),
FastlaneCore::ConfigItem.new(key: :timeout,
description: "Instructs how long (in ms, s, m, or h) saucectl should wait for each suite to complete. You can override this setting for individual suites using the timeout setting within the suites object. If not set, the default value is 0 (unlimited)",
optional: true,
type: String,
default_value: '0')
]
end
|