run_loop 2.2.2 → 2.2.3

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: c125e357c95d69d1ef1e4b74ce1bfbf4faddb920
4
- data.tar.gz: f27d253bba7d6f3faeb4ee37d9f4d0e209d1393b
3
+ metadata.gz: 14c23a62a0cf301b62d65aa43ef9bb51fd0f8100
4
+ data.tar.gz: 4e8f52d124fd7f17975317a09467ad12c39a39d8
5
5
  SHA512:
6
- metadata.gz: 009bddf011cdb692c5ee738b0b9a2e4a3c033e4b01fb29e0db6b548cadea44be2d068b3190af2a34db4b7c38cf7ed880b03c23943a7769f974da0d106ad98742
7
- data.tar.gz: e26d021e69d642bdc9c115e47a235c993b837ac5b88ceaab43570bd86a3f0756de7d37ffea55418cf6818628eeb2cf8af6579decc4ca69924c450dba3a8db6fd
6
+ metadata.gz: 6aaeec05f315cba210c7c914f4f2c7fd50ab996a3fe0e42e4696376cc940d3d05508ba8066542a273fd9764a6400236243b210fad34c513f6c0b2676acf14210
7
+ data.tar.gz: 789c10cfc7de7e83e0622a8b28948bb063360154c5d589d582a386794932ac51f4eacb94d6986900e19444506319b0babb93157f42399c1325d7b5597ee2d602
@@ -369,7 +369,7 @@ Bundle must:
369
369
  def font?(file)
370
370
  extension = File.extname(file)
371
371
 
372
- extension == ".tff" || extension == ".otf"
372
+ extension == ".ttf" || extension == ".otf"
373
373
  end
374
374
  end
375
375
  end
@@ -10,19 +10,22 @@ module RunLoop
10
10
 
11
11
  desc 'tail', 'Tail the log file of the booted simulator'
12
12
  def tail
13
- tail_booted
13
+ tail_simulator_logs
14
14
  end
15
15
 
16
16
  no_commands do
17
- def tail_booted
18
- device = booted_device
19
- if device.nil?
20
- version = xcode.version
21
- puts "No simulator for active Xcode (version #{version}) is booted."
22
- else
23
- log_file = device.simulator_log_file_path
24
- exec('tail', *["-n", "5000", '-F', log_file])
25
- end
17
+ def tail_simulator_logs
18
+ paths = simctl.simulators.map do |simulator|
19
+ log_file_path = simulator.simulator_log_file_path
20
+ if log_file_path && File.exist?(log_file_path)
21
+ log_file_path
22
+ else
23
+ nil
24
+ end
25
+ end.compact
26
+
27
+ args = ["-n", "1000", "-F"] + paths
28
+ exec("tail", *args)
26
29
  end
27
30
  end
28
31
 
@@ -320,7 +320,9 @@ Logfile: #{log_file}
320
320
  # version.
321
321
  def self.default_simulator(xcode=RunLoop::Xcode.new)
322
322
 
323
- if xcode.version_gte_81?
323
+ if xcode.version_gte_82?
324
+ "iPhone 7 (10.2)"
325
+ elsif xcode.version_gte_81?
324
326
  "iPhone 7 (10.1)"
325
327
  elsif xcode.version_gte_8?
326
328
  "iPhone 7 (10.0)"
@@ -28,6 +28,33 @@
28
28
  "default" : true
29
29
  }
30
30
  },
31
+ "upload" : {
32
+ "-b" : {
33
+ "longFlag" : "--bundle-identifier",
34
+ "optionName" : "bundle-id",
35
+ "info" : "bundle identifier (e.g. com.my.app)",
36
+ "required" : true
37
+ },
38
+ "-d" : {
39
+ "longFlag" : "--device-id",
40
+ "optionName" : "device-identifier",
41
+ "info" : "iOS Simulator GUID or 40-digit physical device ID",
42
+ "required" : true
43
+ },
44
+ "-f" : {
45
+ "longFlag" : "--filepath",
46
+ "optionName" : "filepath",
47
+ "info" : "absolute path to file to be uploaded",
48
+ "required" : true
49
+ },
50
+ "-o" : {
51
+ "longFlag" : "--overwrite",
52
+ "optionName" : "overwrite",
53
+ "info" : "overwrite file if already in app container",
54
+ "required" : false,
55
+ "default" : false
56
+ }
57
+ },
31
58
  "is_installed" : {
32
59
  "-b" : {
33
60
  "longFlag" : "--bundle-identifier",
@@ -29,15 +29,16 @@ module RunLoop
29
29
  # For example:
30
30
  #
31
31
  # RunLoop::DeviceAgent::Client::DEFAULTS[:http_timeout] = 60
32
+ # RunLoop::DeviceAgent::Client::DEFAULTS[:device_agent_install_timeout] = 120
32
33
  DEFAULTS = {
33
34
  :port => 27753,
34
35
  :simulator_ip => "127.0.0.1",
35
- :http_timeout => (RunLoop::Environment.ci? || RunLoop::Environment.xtc?) ? 120 : 10,
36
+ :http_timeout => (RunLoop::Environment.ci? || RunLoop::Environment.xtc?) ? 120 : 20,
36
37
  :route_version => "1.0",
37
38
 
38
39
  # Ignored in the XTC.
39
40
  # This key is subject to removal or changes
40
- :device_agent_install_timeout => RunLoop::Environment.ci? ? 120 : 60,
41
+ :device_agent_install_timeout => RunLoop::Environment.ci? ? 120 : 90,
41
42
  # This value must always be false on the XTC.
42
43
  # This is should only be used by gem maintainers or very advanced users.
43
44
  :shutdown_device_agent_before_launch => false
@@ -106,33 +107,20 @@ module RunLoop
106
107
  code_sign_identity = RunLoop::Environment::code_sign_identity
107
108
  end
108
109
 
109
- if device.physical_device? && cbx_launcher.name == :ios_device_manager
110
- if !code_sign_identity
111
- raise RuntimeError, %Q[
112
- Targeting a physical devices requires a code signing identity.
113
-
114
- Rerun your test with:
115
-
116
- $ CODE_SIGN_IDENTITY="iPhone Developer: Your Name (ABCDEF1234)" cucumber
117
-
118
- To see the valid code signing identities on your device run:
119
-
120
- $ xcrun security find-identity -v -p codesigning
121
-
122
- ]
123
- end
124
- end
125
-
126
110
  install_timeout = options.fetch(:device_agent_install_timeout,
127
111
  DEFAULTS[:device_agent_install_timeout])
128
112
  shutdown_before_launch = options.fetch(:shutdown_device_agent_before_launch,
129
113
  DEFAULTS[:shutdown_device_agent_before_launch])
114
+ aut_args = options.fetch(:args, [])
115
+ aut_env = options.fetch(:env, {})
130
116
 
131
117
  launcher_options = {
132
118
  code_sign_identity: code_sign_identity,
133
119
  device_agent_install_timeout: install_timeout,
134
120
  shutdown_device_agent_before_launch: shutdown_before_launch,
135
- dylib_injection_details: dylib_injection_details
121
+ dylib_injection_details: dylib_injection_details,
122
+ aut_args: aut_args,
123
+ aut_env: aut_env
136
124
  }
137
125
 
138
126
  xcuitest = RunLoop::DeviceAgent::Client.new(bundle_id, device,
@@ -307,10 +295,6 @@ INSTANCE METHODS
307
295
  expect_300_response(response)
308
296
  end
309
297
 
310
- # TODO Legacy API; remove once this branch is merged:
311
- # https://github.com/calabash/DeviceAgent.iOS/pull/133
312
- alias_method :runtime, :device_info
313
-
314
298
  # @!visibility private
315
299
  def server_version
316
300
  options = http_options
@@ -362,7 +346,7 @@ INSTANCE METHODS
362
346
  parameters = {
363
347
  :gesture => "enter_text",
364
348
  :options => {
365
- :string => string
349
+ :string => string.to_s
366
350
  }
367
351
  }
368
352
  request = request("gesture", parameters)
@@ -382,7 +366,7 @@ INSTANCE METHODS
382
366
  parameters = {
383
367
  :gesture => "enter_text",
384
368
  :options => {
385
- :string => string
369
+ :string => string.to_s
386
370
  }
387
371
  }
388
372
  request = request("gesture", parameters)
@@ -802,6 +786,8 @@ Timed out after #{timeout} seconds waiting for an alert to disappear.
802
786
  merged_options = WAIT_DEFAULTS.merge(options)
803
787
  result = wait_for_view(uiquery, merged_options)
804
788
 
789
+ # This is not quite right. It is possible to get a false positive.
790
+ # If result does not have "value" or "label" and the text is nil
805
791
  candidates = [result["value"],
806
792
  result["label"]]
807
793
  match = candidates.any? do |elm|
@@ -1250,7 +1236,7 @@ device: #{device}
1250
1236
 
1251
1237
  To diagnose the problem tail the launcher log file:
1252
1238
 
1253
- $ tail -1000 -F #{cbx_launcher.class.log_file}
1239
+ $ tail -1000 -F #{cbx_launcher_log_file}
1254
1240
 
1255
1241
  ]
1256
1242
  end
@@ -1294,9 +1280,19 @@ Please install it.
1294
1280
 
1295
1281
  retries = 5
1296
1282
 
1283
+ # Launch arguments and environment arguments cannot be nil
1284
+ # The public interface Client.run has a guard against this, but
1285
+ # internal callers to do not.
1286
+ aut_args = launcher_options.fetch(:aut_args, [])
1287
+ aut_env = launcher_options.fetch(:aut_env, {})
1297
1288
  begin
1298
1289
  client = http_client(http_options)
1299
- request = request("session", {:bundleID => bundle_id})
1290
+ request = request("session",
1291
+ {
1292
+ :bundleID => bundle_id,
1293
+ :launchArgs => aut_args,
1294
+ :environment => aut_env
1295
+ })
1300
1296
  response = client.post(request)
1301
1297
  RunLoop.log_debug("Launched #{bundle_id} on #{device}")
1302
1298
  RunLoop.log_debug("#{response.body}")
@@ -1421,6 +1417,17 @@ Valid values are: :down, :up, :right, :left, :bottom, :top
1421
1417
  end
1422
1418
  end
1423
1419
 
1420
+ # @!visibility private
1421
+ def cbx_launcher_log_file
1422
+ if cbx_launcher.name == :ios_device_manager
1423
+ # The location of the iOSDeviceManager logs has changed
1424
+ File.join(RunLoop::Environment.user_home_directory,
1425
+ ".calabash", "iOSDeviceManager", "logs", "current.log")
1426
+ else
1427
+ cbx_launcher.class.log_file
1428
+ end
1429
+ end
1430
+
1424
1431
  # @!visibility private
1425
1432
  # Private method. Do not call.
1426
1433
  # Flattens the result of `tree`.
@@ -67,6 +67,15 @@ but binary does not exist at that path.
67
67
  end
68
68
 
69
69
  # @!visibility private
70
+ #
71
+ # In earlier implementations, the ios-device-manager.log was located in
72
+ # ~/.run-loop/xcuitest/ios-device-manager.log
73
+ #
74
+ # Now iOSDeviceManager logs almost everything to a fixed location.
75
+ #
76
+ # ~/.calabash/iOSDeviceManager/logs/current.log
77
+ #
78
+ # There is still occasional output to ~/.run-loop.
70
79
  def self.log_file
71
80
  path = File.join(LauncherStrategy.dot_dir, "ios-device-manager.log")
72
81
  FileUtils.touch(path) if !File.exist?(path)
@@ -98,27 +107,24 @@ Expected :device_agent_install_timeout key in options:
98
107
 
99
108
  #{options}
100
109
 
101
- ]
102
- end
103
-
104
- if !code_sign_identity
105
- raise ArgumentError, %Q[
106
- Targeting a physical devices requires a code signing identity.
107
-
108
- Rerun your test with:
109
-
110
- $ CODE_SIGN_IDENTITY="iPhone Developer: Your Name (ABCDEF1234)" cucumber
111
-
112
110
  ]
113
111
  end
114
112
 
115
113
  options = {:log_cmd => true, :timeout => install_timeout}
116
- args = [
117
- cmd, "install",
118
- "--device-id", device.udid,
119
- "--app-bundle", runner.runner,
120
- "--codesign-identity", code_sign_identity
121
- ]
114
+ if code_sign_identity
115
+ args = [
116
+ cmd, "install",
117
+ "--device-id", device.udid,
118
+ "--app-bundle", runner.runner,
119
+ "--codesign-identity", code_sign_identity
120
+ ]
121
+ else
122
+ args = [
123
+ cmd, "install",
124
+ "--device-id", device.udid,
125
+ "--app-bundle", runner.runner
126
+ ]
127
+ end
122
128
 
123
129
  start = Time.now
124
130
  hash = run_shell_command(args, options)
@@ -15,3 +15,19 @@ module AwesomePrint
15
15
  end
16
16
  end
17
17
  end
18
+
19
+ module Kernel
20
+ # Patch for BasicObject inspections.
21
+ # https://github.com/awesome-print/awesome_print/pull/253
22
+ def ap(object, options = {})
23
+ if object_id
24
+ begin
25
+ puts object.ai(options)
26
+ rescue NoMethodError => _
27
+ puts "(Object doesn't support #inspect)"
28
+ end
29
+
30
+ object unless AwesomePrint.console?
31
+ end
32
+ end
33
+ end
@@ -1,5 +1,5 @@
1
1
  module RunLoop
2
- VERSION = "2.2.2"
2
+ VERSION = "2.2.3"
3
3
 
4
4
  # A model of a software release version that can be used to compare two versions.
5
5
  #
@@ -24,6 +24,14 @@ module RunLoop
24
24
  to_s
25
25
  end
26
26
 
27
+ # Returns a version instance for Xcode 8.2 ; used to check for the
28
+ # availability of features and paths to various items on the filesystem
29
+ #
30
+ # @return [RunLoop::Version] 8.2
31
+ def v82
32
+ fetch_version(:v82)
33
+ end
34
+
27
35
  # Returns a version instance for `Xcode 8.1`; used to check for the
28
36
  # availability of features and paths to various items on the filesystem.
29
37
  #
@@ -128,9 +136,16 @@ module RunLoop
128
136
  fetch_version(:v50)
129
137
  end
130
138
 
139
+ # Is the active Xcode version 8.2 or above?
140
+ #
141
+ # @return [Boolean] `true` if the current Xcode version is >= 8.2
142
+ def version_gte_82?
143
+ version >= v82
144
+ end
145
+
131
146
  # Is the active Xcode version 8.1 or above?
132
147
  #
133
- # @return [Boolean] `true` if the current Xcode version is >= 8.0
148
+ # @return [Boolean] `true` if the current Xcode version is >= 8.1
134
149
  def version_gte_81?
135
150
  version >= v81
136
151
  end
@@ -155,6 +155,23 @@ function frenchLocalizations() {
155
155
  ];
156
156
  }
157
157
 
158
+ function portugueseBrazilLocalizations() {
159
+ return [
160
+ ["Permitir", /acesso à sua localização/],
161
+ ["Permitir", /acesso à sua localização/],
162
+ ["OK", /Deseja Ter Acesso às Suas Fotos/],
163
+ ["OK", /Deseja Ter Acesso aos Seus Contatos/],
164
+ ["OK", /Acesso ao Seu Calendário/],
165
+ ["OK", /Deseja Ter Acesso aos Seus Lembretes/],
166
+ ["OK", /Would Like to Access Your Motion Activity/],
167
+ ["OK", /Deseja Ter Acesso à Câmera/],
168
+ ["OK", /Deseja Ter Acesso às Suas Atividades de Movimento e Preparo Físico/],
169
+ ["OK", /Deseja Ter Acesso às Contas do Twitter/],
170
+ ["OK", /data available to nearby bluetooth devices/],
171
+ ["OK", /[Dd]eseja [Ee]nviar-lhe [Nn]otificações/]
172
+ ];
173
+ }
174
+
158
175
  function localizations() {
159
176
  return [].concat(
160
177
  danishLocalizations(),
@@ -163,7 +180,8 @@ function localizations() {
163
180
  germanLocalizations(),
164
181
  russianLocalizations(),
165
182
  spanishLocalizations(),
166
- frenchLocalizations()
183
+ frenchLocalizations(),
184
+ portugueseBrazilLocalizations()
167
185
  );
168
186
  }
169
187
 
@@ -207,8 +225,8 @@ function isPrivacyAlert(alert) {
207
225
  // $ APP_LANG="nl" APP_LOCALE="nl" be cucumber -t @supported -p macmini
208
226
 
209
227
  // This is very slow, so only do this if you are trying to capture regexes.
210
- //var buttonNames = findAlertButtonNames(alert);
211
- //Log.output({"alert":{"title":title, "buttons":buttonNames, "capture":"YES"}});
228
+ // var buttonNames = findAlertButtonNames(alert);
229
+ // Log.output({"alert":{"title":title, "buttons":buttonNames, "capture":"YES"}});
212
230
 
213
231
  var answer;
214
232
  var expression;
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.2.2
4
+ version: 2.2.3
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: 2016-10-13 00:00:00.000000000 Z
12
+ date: 2016-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -301,20 +301,6 @@ dependencies:
301
301
  - - ">="
302
302
  - !ruby/object:Gem::Version
303
303
  version: '0'
304
- - !ruby/object:Gem::Dependency
305
- name: rb-readline
306
- requirement: !ruby/object:Gem::Requirement
307
- requirements:
308
- - - ">="
309
- - !ruby/object:Gem::Version
310
- version: '0'
311
- type: :development
312
- prerelease: false
313
- version_requirements: !ruby/object:Gem::Requirement
314
- requirements:
315
- - - ">="
316
- - !ruby/object:Gem::Version
317
- version: '0'
318
304
  description:
319
305
  email:
320
306
  - karl.krukow@xamarin.com