calabash-cucumber 0.9.121 → 0.9.122
Sign up to get free protection for your applications and to get access to all the features.
@@ -43,7 +43,7 @@ def reset_app_jail(sdk, app_path)
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
def relaunch
|
46
|
+
def relaunch(args=nil)
|
47
47
|
if ENV['NO_LAUNCH']!="1"
|
48
48
|
sdk = ENV['SDK_VERSION'] || SimLauncher::SdkDetector.new().latest_sdk_version
|
49
49
|
path = Calabash::Cucumber::SimulatorHelper.app_bundle_or_raise(app_path)
|
@@ -51,7 +51,7 @@ def relaunch
|
|
51
51
|
reset_app_jail(sdk, path)
|
52
52
|
end
|
53
53
|
|
54
|
-
Calabash::Cucumber::SimulatorHelper.relaunch(path,sdk,ENV['DEVICE'] || 'iphone')
|
54
|
+
Calabash::Cucumber::SimulatorHelper.relaunch(path,sdk,ENV['DEVICE'] || 'iphone', args)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -18,10 +18,10 @@ module Calabash
|
|
18
18
|
|
19
19
|
DEFAULT_SIM_RETRY = 2
|
20
20
|
|
21
|
-
def self.relaunch(path, sdk = nil, version = 'iphone')
|
21
|
+
def self.relaunch(path, sdk = nil, version = 'iphone', args = nil)
|
22
22
|
|
23
23
|
app_bundle_path = app_bundle_or_raise(path)
|
24
|
-
ensure_connectivity(app_bundle_path, sdk, version)
|
24
|
+
ensure_connectivity(app_bundle_path, sdk, version, args)
|
25
25
|
|
26
26
|
end
|
27
27
|
|
@@ -169,7 +169,7 @@ module Calabash
|
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
172
|
-
def self.ensure_connectivity(app_bundle_path, sdk, version)
|
172
|
+
def self.ensure_connectivity(app_bundle_path, sdk, version, args = nil)
|
173
173
|
begin
|
174
174
|
max_retry_count = (ENV['MAX_CONNECT_RETRY'] || DEFAULT_SIM_RETRY).to_i
|
175
175
|
timeout = (ENV['CONNECT_TIMEOUT'] || DEFAULT_SIM_WAIT).to_i
|
@@ -183,7 +183,7 @@ module Calabash
|
|
183
183
|
puts "(#{retry_count}.) Start Simulator #{sdk}, #{version}, for #{app_bundle_path}"
|
184
184
|
begin
|
185
185
|
Timeout::timeout(timeout, TimeoutErr) do
|
186
|
-
simulator = launch(app_bundle_path, sdk, version)
|
186
|
+
simulator = launch(app_bundle_path, sdk, version, args)
|
187
187
|
until connected
|
188
188
|
begin
|
189
189
|
connected = (ping_app == '405')
|
@@ -195,6 +195,7 @@ module Calabash
|
|
195
195
|
if connected
|
196
196
|
server_version = get_version
|
197
197
|
if server_version
|
198
|
+
p server_version
|
198
199
|
unless version_check(server_version)
|
199
200
|
msgs = ["You're running an older version of Calabash server with a newer client",
|
200
201
|
"Client:#{Calabash::Cucumber::VERSION}",
|
@@ -220,7 +221,8 @@ module Calabash
|
|
220
221
|
puts "Timed out..."
|
221
222
|
end
|
222
223
|
end
|
223
|
-
rescue
|
224
|
+
rescue e
|
225
|
+
p e
|
224
226
|
msg = "Unable to make connection to Calabash Server at #{ENV['DEVICE_ENDPOINT']|| "http://localhost:37265/"}\n"
|
225
227
|
msg << "Make sure you've' linked correctly with calabash.framework and set Other Linker Flags.\n"
|
226
228
|
msg << "Make sure you don't have a firewall blocking traffic to #{ENV['DEVICE_ENDPOINT']|| "http://localhost:37265/"}.\n"
|
@@ -229,10 +231,10 @@ module Calabash
|
|
229
231
|
end
|
230
232
|
|
231
233
|
|
232
|
-
def self.launch(app_bundle_path, sdk, version)
|
234
|
+
def self.launch(app_bundle_path, sdk, version, args = nil)
|
233
235
|
simulator = SimLauncher::Simulator.new
|
234
236
|
simulator.quit_simulator
|
235
|
-
simulator.launch_ios_app(app_bundle_path, sdk, version)
|
237
|
+
simulator.launch_ios_app(app_bundle_path, sdk, version) #, args wait for update to sim launcher
|
236
238
|
simulator
|
237
239
|
end
|
238
240
|
|
@@ -264,9 +266,10 @@ module Calabash
|
|
264
266
|
if res['iOS_version']
|
265
267
|
@ios_version = res['iOS_version']
|
266
268
|
end
|
269
|
+
res
|
267
270
|
rescue
|
271
|
+
nil
|
268
272
|
end
|
269
|
-
nil
|
270
273
|
end
|
271
274
|
|
272
275
|
def self.ios_version
|