run_loop 2.6.4 → 2.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f34759f1732f827f94bac7ea971ce9e16010c48
4
- data.tar.gz: 4fd92c7cc7f753e1520e54b998ba560480a118a3
3
+ metadata.gz: 266de128105ce734157606450773b307964acbad
4
+ data.tar.gz: 2a1f99bc14a3b03c5563920f2e2fed3543f5310d
5
5
  SHA512:
6
- metadata.gz: a3f8b8d2e0641ba5eb52156af207acae7de240e1ab30dd83f55b22417a99b4b72b9ecb4d504b142c56927f23e1f35179092477b819ff0afe013cd52a11128a36
7
- data.tar.gz: eebfaa502c8844d7e1562569315724e86bc4975dce594ea0e68fbe9c84ebd9a767c3978639f2a316ff922b3125d477b1c4815550cebe2682eab2ab2fea1d031a
6
+ metadata.gz: 908bbb329290e2e20d3cfec119feb0788b55455b54f77666310b24bf6f8e448ce8579030a3ec8452bdeb8be2bc121365569bf459f32ac72cdfb6f2af8d23ece7
7
+ data.tar.gz: f73882994629901706c526d9d3d91154b0dd6e3e7222ae2158cdd15233212c30e4fb2440ff38fbe65c7b42cab4e52bb0f5fd129fa912be1f61d25213cd7c970f
data/lib/run_loop/core.rb CHANGED
@@ -320,12 +320,14 @@ Logfile: #{log_file}
320
320
  # version.
321
321
  def self.default_simulator(xcode=RunLoop::Xcode.new)
322
322
 
323
- if xcode.version_gte_92?
324
- "iPhone 7 (11.2)"
323
+ if xcode.version_gte_93?
324
+ "iPhone 8 (11.3)"
325
+ elsif xcode.version_gte_92?
326
+ "iPhone 8 (11.2)"
325
327
  elsif xcode.version_gte_91?
326
- "iPhone 7 (11.1)"
328
+ "iPhone 8 (11.1)"
327
329
  elsif xcode.version_gte_90?
328
- "iPhone 7 (11.0)"
330
+ "iPhone 8 (11.0)"
329
331
  elsif xcode.version_gte_83?
330
332
  "iPhone 7 (10.3)"
331
333
  elsif xcode.version_gte_82?
@@ -131,6 +131,8 @@ class RunLoop::CoreSimulator
131
131
  # as testing proceeds and can cause instability.
132
132
  def self.terminate_core_simulator_processes
133
133
 
134
+ start = Time.now
135
+
134
136
  self.quit_simulator
135
137
 
136
138
  MANAGED_PROCESSES.each do |process_name|
@@ -148,7 +150,8 @@ class RunLoop::CoreSimulator
148
150
  end
149
151
  end
150
152
 
151
- kill_options = { :timeout => 0.5 }
153
+ term_options = { :timeout => 0.1 }
154
+ kill_options = { :timeout => 0.0 }
152
155
 
153
156
  RunLoop::ProcessWaiter.pgrep_f("launchd_sim").each do |pid|
154
157
  process_name = ps_name_fn.call(pid)
@@ -160,6 +163,24 @@ class RunLoop::CoreSimulator
160
163
  RunLoop::ProcessTerminator.new(pid, 'KILL', process_name, kill_options).kill_process
161
164
  end
162
165
 
166
+ RunLoop::ProcessWaiter.pgrep_f("CoreSimulator").each do |pid|
167
+ args = ["ps", "-o", "uid=", pid.to_s]
168
+ uid = RunLoop::Shell.run_shell_command(args)[:out].strip
169
+ process_name = File.basename(ps_name_fn.call(pid))
170
+ if uid != "0"
171
+
172
+ term = RunLoop::ProcessTerminator.new(pid, 'TERM', process_name, term_options)
173
+ killed = term.kill_process
174
+
175
+ if !killed
176
+ term = RunLoop::ProcessTerminator.new(pid, 'KILL', process_name, kill_options)
177
+ term.kill_process
178
+ end
179
+ end
180
+ end
181
+
182
+ elapsed = Time.now - start
183
+ RunLoop.log_debug("Took #{elapsed} to terminate CoreSimulator Services")
163
184
  end
164
185
 
165
186
  # @!visibility private
@@ -402,6 +423,7 @@ class RunLoop::CoreSimulator
402
423
  args = ['open', '-g', '-a', sim_app_path, '--args',
403
424
  '-CurrentDeviceUDID', device.udid,
404
425
  "-ConnectHardwareKeyboard", "0",
426
+ "-DeviceBootTimeout", "120",
405
427
  "LAUNCHED_BY_RUN_LOOP"]
406
428
 
407
429
  RunLoop.log_debug("Launching #{device} with:")
@@ -542,7 +564,7 @@ Could not launch #{app.bundle_identifier} on #{device} after trying #{tries} tim
542
564
  # Send 'TERM' then 'KILL' to allow processes to quit cleanly.
543
565
  def self.term_or_kill(process_name, send_term_first)
544
566
  term_options = { :timeout => 0.5 }
545
- kill_options = { :timeout => 0.5 }
567
+ kill_options = { :timeout => 0.0 }
546
568
 
547
569
  RunLoop::ProcessWaiter.new(process_name).pids.each do |pid|
548
570
 
@@ -750,7 +750,11 @@ https://github.com/calabash/calabash-ios/wiki/Testing-on-Physical-Devices
750
750
  # @!visibility private
751
751
  def simulator_running_system_app_pids
752
752
  base_dir = xcode.developer_dir
753
- sim_apps_dir = "Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications"
753
+ if xcode.version_gte_90?
754
+ sim_apps_dir = "Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Applications"
755
+ else
756
+ sim_apps_dir = "Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications"
757
+ end
754
758
  path = File.expand_path(File.join(base_dir, sim_apps_dir))
755
759
  RunLoop::ProcessWaiter.pgrep_f(path)
756
760
  end
@@ -809,6 +809,13 @@ Could not dismiss SpringBoard alert by touching button with title '#{button_titl
809
809
  json
810
810
  end
811
811
 
812
+ def element_types
813
+ request = request("element-types")
814
+ client = http_client(http_options)
815
+ response = client.get(request)
816
+ expect_300_response(response)["types"]
817
+ end
818
+
812
819
  # TODO: animation model
813
820
  def wait_for_animations
814
821
  sleep(0.5)
@@ -1264,6 +1271,38 @@ PRIVATE
1264
1271
  expect_300_response(response)
1265
1272
  end
1266
1273
 
1274
+ # @!visibility private
1275
+ def app_state(bundle_identifier)
1276
+ request = request("pid", { bundleID: bundle_identifier })
1277
+ client = http_client(http_options)
1278
+ response = client.post(request)
1279
+ expect_300_response(response)["state_string"]
1280
+ end
1281
+
1282
+ # @!visibility private
1283
+ def send_app_to_background(bundle_identifier, options={})
1284
+ state = app_state(bundle_identifier)
1285
+
1286
+ if state != "foreground"
1287
+ raise(RuntimeError, %Q[
1288
+
1289
+ Expected '#{bundle_identifier}' to be in the foreground, but found '#{state}'"
1290
+
1291
+ ])
1292
+
1293
+ else
1294
+ parameters = {
1295
+ # How long to touch the home bottom.
1296
+ duration: 0.001
1297
+ }.merge(options)
1298
+
1299
+ request = request("home", parameters)
1300
+ client = http_client(http_options)
1301
+ response = client.post(request)
1302
+ expect_300_response(response)["state_string"]
1303
+ end
1304
+ end
1305
+
1267
1306
  # @!visibility private
1268
1307
  def session_identifier
1269
1308
  options = http_options
@@ -1373,7 +1412,7 @@ If the body empty, the DeviceAgent has probably crashed.
1373
1412
  return false if !running?
1374
1413
 
1375
1414
  version_info = server_version
1376
- running_version_timestamp = version_info[:bundle_version].to_i
1415
+ running_version_timestamp = version_info["bundle_version"].to_i
1377
1416
 
1378
1417
  app = RunLoop::App.new(cbx_launcher.runner.runner)
1379
1418
  plist_buddy = RunLoop::PlistBuddy.new
@@ -70,8 +70,12 @@ module RunLoop
70
70
  rescue SignalException => e
71
71
  raise e.message
72
72
  end
73
- RunLoop.log_debug("Waiting for #{display_name} with pid '#{pid}' to terminate")
74
- wait_for_process_to_terminate
73
+ if options[:timeout].to_f <= 0.0
74
+ RunLoop.log_debug("Not waiting for process #{display_name} : #{pid} to terminate")
75
+ else
76
+ RunLoop.log_debug("Waiting for #{display_name} with pid '#{pid}' to terminate")
77
+ wait_for_process_to_terminate
78
+ end
75
79
  end
76
80
 
77
81
  # Is the process `pid` alive?
@@ -1,5 +1,5 @@
1
1
  module RunLoop
2
- VERSION = "2.6.4"
2
+ VERSION = "2.6.5"
3
3
 
4
4
  # A model of a software release version that can be used to compare two versions.
5
5
  #
@@ -26,6 +26,14 @@ module RunLoop
26
26
  to_s
27
27
  end
28
28
 
29
+ # Returns a version instance for Xcode 9.3; used to check for the
30
+ # availability of features and paths to various items on the filesystem
31
+ #
32
+ # @return [RunLoop::Version] 9.3
33
+ def v93
34
+ fetch_version(:v93)
35
+ end
36
+
29
37
  # Returns a version instance for Xcode 9.2; used to check for the
30
38
  # availability of features and paths to various items on the filesystem
31
39
  #
@@ -169,8 +177,14 @@ module RunLoop
169
177
  def v50
170
178
  fetch_version(:v50)
171
179
  end
180
+ # Is the active Xcode version 9.3 or above?
181
+ #
182
+ # @return [Boolean] `true` if the current Xcode version is >= 9.3
183
+ def version_gte_93?
184
+ version >= v93
185
+ end
172
186
 
173
- # Is the active Xcode version 9.1 or above?
187
+ # Is the active Xcode version 9.2 or above?
174
188
  #
175
189
  # @return [Boolean] `true` if the current Xcode version is >= 9.2
176
190
  def version_gte_92?
@@ -163,8 +163,23 @@ function swedishLocalizations() {
163
163
 
164
164
  function russianLocalizations() {
165
165
  return [
166
- // Location
167
- ["OK", /запрашивает разрешение на использование Ващей текущей пгеопозиции/]
166
+ ["OK", /запрашивает разрешение на использование Вашей текущей геопозиции/],
167
+ ["OK", /запрашивает разрешение на доступ к учетным записям Twitter/],
168
+ ["Открыть", /Открыть в программе/],
169
+ ["Разрешить", /запрашивает доступ к «Камере»./],
170
+ ["Разрешить", /запрашивает доступ к «Фото»./],
171
+ ["Разрешить", /запрашивает доступ к микрофону./],
172
+ ["Разрешить", /Разрешить доступ к Вашим геоданным/],
173
+ ["Разрешить", /доступ к Вашей геопозиции, даже когда Вы не работаете с этой программой?/],
174
+ ["Разрешить", /доступ к Вашей геопозиции, пока Вы работаете с этой программой?/],
175
+ ["Разрешить", /доступ к Вашей геопозиции, даже когда Вы не работаете с ней?/],
176
+ ["Разрешить", /доступ к Вашей геопозиции, пока Вы работаете с ней?/],
177
+ ["Разрешить", /запрашивает доступ к «Контактам»./],
178
+ ["Разрешить", /запрашивает доступ к «Напоминаниям»./],
179
+ ["Разрешать всегда", /доступ к Вашей геопозиции?/],
180
+ ["Разрешить", /запрашивает доступ к «Календарю»./],
181
+ ["Разрешить", /запрашивает доступ к Вашим данным движения и фитнеса/],
182
+ ["Разрешить", /запрашивает разрешение на отправку Вам уведомлений./]
168
183
  ];
169
184
  }
170
185
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_loop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.4
4
+ version: 2.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-01-26 00:00:00.000000000 Z
12
+ date: 2018-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json