run_loop 2.3.2 β 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/run_loop/app.rb +7 -1
- data/lib/run_loop/device_agent/Frameworks.zip +0 -0
- data/lib/run_loop/device_agent/app/DeviceAgent-Runner.app.zip +0 -0
- data/lib/run_loop/device_agent/bin/iOSDeviceManager +0 -0
- data/lib/run_loop/device_agent/client.rb +63 -3
- data/lib/run_loop/device_agent/ios_device_manager.rb +29 -5
- data/lib/run_loop/device_agent/ipa/DeviceAgent-Runner.app.zip +0 -0
- data/lib/run_loop/device_agent/xcodebuild.rb +7 -5
- data/lib/run_loop/encoding.rb +1 -1
- data/lib/run_loop/version.rb +1 -1
- data/scripts/lib/on_alert.js +20 -3
- metadata +6 -12
- data/lib/run_loop/cli/idm.rb +0 -71
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a7552a576fe17fc056f8bd701a86c3f9b48a494d
|
4
|
+
data.tar.gz: 3cc4607e284f43dd237059386d2c4d1e97dc1934
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2adcaae646576ab37d3ab5e0a9afff7dfcb13f262e53f1ef545521b3ca325054f0cd00b22038511d8fdad11b2c5d9072b070a64f60d645302919327977ac25a0
|
7
|
+
data.tar.gz: 21e54fdbf93061cb3a7ba279aede270c25e2118c22474f13a11c22a93d9c43916b4eaf52d92538878c2ef97e9311d57e69bc70bbe96bb84cf73f8799fef11ff9
|
data/lib/run_loop/app.rb
CHANGED
@@ -286,7 +286,8 @@ Bundle must:
|
|
286
286
|
lproj_asset?(file) ||
|
287
287
|
code_signing_asset?(file) ||
|
288
288
|
core_data_asset?(file) ||
|
289
|
-
font?(file)
|
289
|
+
font?(file) ||
|
290
|
+
build_artifact?(file)
|
290
291
|
end
|
291
292
|
|
292
293
|
# @!visibility private
|
@@ -371,6 +372,11 @@ Bundle must:
|
|
371
372
|
|
372
373
|
extension == ".ttf" || extension == ".otf"
|
373
374
|
end
|
375
|
+
|
376
|
+
# @!visibility private
|
377
|
+
def build_artifact?(file)
|
378
|
+
File.extname(file) == ".xcconfig"
|
379
|
+
end
|
374
380
|
end
|
375
381
|
end
|
376
382
|
|
Binary file
|
Binary file
|
Binary file
|
@@ -564,8 +564,7 @@ Query must contain at least one of these keys:
|
|
564
564
|
request = request("springboard-alert")
|
565
565
|
client = http_client(http_options)
|
566
566
|
response = client.get(request)
|
567
|
-
|
568
|
-
hash["result"]
|
567
|
+
expect_300_response(response)
|
569
568
|
end
|
570
569
|
|
571
570
|
# @!visibility private
|
@@ -573,6 +572,39 @@ Query must contain at least one of these keys:
|
|
573
572
|
!springboard_alert.empty?
|
574
573
|
end
|
575
574
|
|
575
|
+
# @!visibility private
|
576
|
+
def dismiss_springboard_alert(button_title)
|
577
|
+
parameters = { :button_title => button_title }
|
578
|
+
request = request("dismiss-springboard-alert", parameters)
|
579
|
+
client = http_client(http_options)
|
580
|
+
response = client.post(request)
|
581
|
+
hash = expect_300_response(response)
|
582
|
+
|
583
|
+
if hash["error"]
|
584
|
+
raise RuntimeError, %Q[
|
585
|
+
Could not dismiss SpringBoard alert by touching button with title '#{button_title}':
|
586
|
+
|
587
|
+
#{hash["error"]}
|
588
|
+
|
589
|
+
]
|
590
|
+
end
|
591
|
+
true
|
592
|
+
end
|
593
|
+
|
594
|
+
# @!visibility private
|
595
|
+
def set_dismiss_springboard_alerts_automatically(true_or_false)
|
596
|
+
if ![true, false].include?(true_or_false)
|
597
|
+
raise ArgumentError, "Expected #{true_or_false} to be a boolean true or false"
|
598
|
+
end
|
599
|
+
|
600
|
+
parameters = { :dismiss_automatically => true_or_false }
|
601
|
+
request = request("set-dismiss-springboard-alerts-automatically", parameters)
|
602
|
+
client = http_client(http_options)
|
603
|
+
response = client.post(request)
|
604
|
+
hash = expect_300_response(response)
|
605
|
+
hash["is_dismissing_alerts_automatically"]
|
606
|
+
end
|
607
|
+
|
576
608
|
# @!visibility private
|
577
609
|
# @see #query
|
578
610
|
def query_for_coordinate(uiquery)
|
@@ -804,6 +836,20 @@ Timed out after #{timeout} seconds waiting for an alert to appear.
|
|
804
836
|
end
|
805
837
|
end
|
806
838
|
|
839
|
+
# @!visibility private
|
840
|
+
def wait_for_springboard_alert(timeout=WAIT_DEFAULTS[:timeout])
|
841
|
+
options = WAIT_DEFAULTS.dup
|
842
|
+
options[:timeout] = timeout
|
843
|
+
message = %Q[
|
844
|
+
|
845
|
+
Timed out after #{timeout} seconds waiting for a SpringBoard alert to appear.
|
846
|
+
|
847
|
+
]
|
848
|
+
wait_for(message, options) do
|
849
|
+
springboard_alert_visible?
|
850
|
+
end
|
851
|
+
end
|
852
|
+
|
807
853
|
# @!visibility private
|
808
854
|
def wait_for_no_alert(timeout=WAIT_DEFAULTS[:timeout])
|
809
855
|
options = WAIT_DEFAULTS.dup
|
@@ -819,6 +865,20 @@ Timed out after #{timeout} seconds waiting for an alert to disappear.
|
|
819
865
|
end
|
820
866
|
end
|
821
867
|
|
868
|
+
# @!visibility private
|
869
|
+
def wait_for_no_springboard_alert(timeout=WAIT_DEFAULTS[:timeout])
|
870
|
+
options = WAIT_DEFAULTS.dup
|
871
|
+
options[:timeout] = timeout
|
872
|
+
message = %Q[
|
873
|
+
|
874
|
+
Timed out after #{timeout} seconds waiting for a SpringBoard alert to disappear.
|
875
|
+
|
876
|
+
]
|
877
|
+
wait_for(message, options) do
|
878
|
+
!springboard_alert_visible?
|
879
|
+
end
|
880
|
+
end
|
881
|
+
|
822
882
|
# @!visibility private
|
823
883
|
def wait_for_text_in_view(text, uiquery, options={})
|
824
884
|
merged_options = WAIT_DEFAULTS.merge(options)
|
@@ -1212,7 +1272,7 @@ PRIVATE
|
|
1212
1272
|
|
1213
1273
|
RunLoop.log_debug("Waited for #{Time.now - now} seconds for DeviceAgent to shutdown")
|
1214
1274
|
end
|
1215
|
-
rescue RunLoop::DeviceAgent::Client::HTTPError => e
|
1275
|
+
rescue RunLoop::DeviceAgent::Client::HTTPError, HTTPClient::ReceiveTimeoutError => e
|
1216
1276
|
RunLoop.log_debug("DeviceAgent-Runner shutdown error: #{e.message}")
|
1217
1277
|
ensure
|
1218
1278
|
if @launcher_pid
|
@@ -109,7 +109,8 @@ Expected :device_agent_install_timeout key in options:
|
|
109
109
|
]
|
110
110
|
end
|
111
111
|
|
112
|
-
|
112
|
+
shell_options = {:log_cmd => true, :timeout => install_timeout}
|
113
|
+
|
113
114
|
args = [
|
114
115
|
cmd, "install",
|
115
116
|
"--device-id", device.udid,
|
@@ -122,7 +123,7 @@ Expected :device_agent_install_timeout key in options:
|
|
122
123
|
end
|
123
124
|
|
124
125
|
start = Time.now
|
125
|
-
hash = run_shell_command(args,
|
126
|
+
hash = run_shell_command(args, shell_options)
|
126
127
|
|
127
128
|
if hash[:exit_status] != 0
|
128
129
|
raise RuntimeError, %Q[
|
@@ -137,7 +138,11 @@ Could not install #{runner.runner}. iOSDeviceManager says:
|
|
137
138
|
|
138
139
|
RunLoop::log_debug("Took #{Time.now - start} seconds to install DeviceAgent");
|
139
140
|
|
140
|
-
|
141
|
+
cmd = "xcrun"
|
142
|
+
args = ["xcodebuild", "test-without-building",
|
143
|
+
"-xctestrun", path_to_xctestrun(device),
|
144
|
+
"-destination", "id=#{device.udid}",
|
145
|
+
"-derivedDataPath", derived_data_directory]
|
141
146
|
|
142
147
|
log_file = IOSDeviceManager.log_file
|
143
148
|
FileUtils.rm_rf(log_file)
|
@@ -150,8 +155,6 @@ Could not install #{runner.runner}. iOSDeviceManager says:
|
|
150
155
|
options = {:out => log_file, :err => log_file}
|
151
156
|
RunLoop.log_unix_cmd("#{cmd} #{args.join(" ")} >& #{log_file}")
|
152
157
|
|
153
|
-
# Gotta keep the ios_device_manager process alive or the connection
|
154
|
-
# to testmanagerd will fail.
|
155
158
|
pid = Process.spawn(env, cmd, *args, options)
|
156
159
|
Process.detach(pid)
|
157
160
|
|
@@ -196,6 +199,27 @@ iOSDeviceManager says:
|
|
196
199
|
|
197
200
|
hash[:exit_status] == 0
|
198
201
|
end
|
202
|
+
|
203
|
+
def path_to_xctestrun(device)
|
204
|
+
if device.physical_device?
|
205
|
+
File.join(runner.tester, "DeviceAgent-device.xctestrun")
|
206
|
+
else
|
207
|
+
template = File.join(runner.tester, "DeviceAgent-simulator-template.xctestrun")
|
208
|
+
path = File.join(RunLoop::DotDir.directory, "xcuitest", "DeviceAgent-simulator.xctestrun")
|
209
|
+
contents = File.read(template).force_encoding("UTF-8")
|
210
|
+
substituted = contents.gsub("TEST_HOST_PATH", runner.runner)
|
211
|
+
File.open(path, "w:UTF-8") do |file|
|
212
|
+
file.write(substituted)
|
213
|
+
end
|
214
|
+
path
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
def derived_data_directory
|
219
|
+
path = File.join(RunLoop::DotDir.directory, "xcuitest", "DerivedData")
|
220
|
+
FileUtils.mkdir_p(path) if !File.exist?(path)
|
221
|
+
path
|
222
|
+
end
|
199
223
|
end
|
200
224
|
end
|
201
225
|
end
|
Binary file
|
@@ -75,16 +75,12 @@ Use the CBXWS environment variable to override the default.
|
|
75
75
|
args = [
|
76
76
|
"xcrun",
|
77
77
|
"xcodebuild",
|
78
|
+
"-derivedDataPath", derived_data_directory,
|
78
79
|
"-scheme", "AppStub",
|
79
80
|
"-workspace", workspace,
|
80
81
|
"-config", "Debug",
|
81
82
|
"-destination",
|
82
83
|
"id=#{device.udid}",
|
83
|
-
"CLANG_ENABLE_CODE_COVERAGE=YES",
|
84
|
-
"GCC_GENERATE_TEST_COVERAGE_FILES=NO",
|
85
|
-
"GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO",
|
86
|
-
# Scheme setting.
|
87
|
-
"-enableCodeCoverage", "YES",
|
88
84
|
"test"
|
89
85
|
]
|
90
86
|
|
@@ -113,6 +109,12 @@ Use the CBXWS environment variable to override the default.
|
|
113
109
|
relative = File.expand_path(File.join(this_dir, "..", "..", "..", ".."))
|
114
110
|
File.join(relative, "DeviceAgent.iOS/DeviceAgent.xcworkspace")
|
115
111
|
end
|
112
|
+
|
113
|
+
def derived_data_directory
|
114
|
+
path = File.join(Xcodebuild.dot_dir, "DerivedData")
|
115
|
+
FileUtils.mkdir_p(path) if !File.exist?(path)
|
116
|
+
path
|
117
|
+
end
|
116
118
|
end
|
117
119
|
end
|
118
120
|
end
|
data/lib/run_loop/encoding.rb
CHANGED
@@ -5,7 +5,7 @@ module RunLoop
|
|
5
5
|
# Removes diacritic markers from string.
|
6
6
|
#
|
7
7
|
# The ruby Encoding tools cannot perform this action, they can only change
|
8
|
-
# convert one
|
8
|
+
# convert one encoding to another by substituting characters.
|
9
9
|
#
|
10
10
|
# In ruby 1.9.3 we would have used Iconv, but that does not exist in 2.0.
|
11
11
|
#
|
data/lib/run_loop/version.rb
CHANGED
data/scripts/lib/on_alert.js
CHANGED
@@ -43,7 +43,8 @@ function englishLocalizations() {
|
|
43
43
|
["OK", /Would Like to Access Your Motion & Fitness Activity/],
|
44
44
|
["OK", /Would Like Access to Twitter Accounts/],
|
45
45
|
["OK", /data available to nearby bluetooth devices/],
|
46
|
-
["OK", /[Ww]ould [Ll]ike to [Ss]end [Yy]ou( Push)? Notifications/]
|
46
|
+
["OK", /[Ww]ould [Ll]ike to [Ss]end [Yy]ou( Push)? Notifications/],
|
47
|
+
["Allow", /Would Like to Add VPN Configurations/]
|
47
48
|
];
|
48
49
|
}
|
49
50
|
|
@@ -201,6 +202,22 @@ function portugueseBrazilLocalizations() {
|
|
201
202
|
];
|
202
203
|
}
|
203
204
|
|
205
|
+
function koreanLocalizations() {
|
206
|
+
return [
|
207
|
+
["νμ©", /μμ μ¬μ©μμ μμΉμ μ κ·Όνλλ‘ νμ©νκ² μ΅λκΉ/],
|
208
|
+
["νμ©", /μ(λ₯Ό) μ¬μ©νμ§ μμ λμλ ν΄λΉ μ±μ΄ μ¬μ©μμ μμΉμ μ κ·Όνλλ‘ νμ©νκ³μ΅λκΉ/],
|
209
|
+
["μΉμΈ", /μ΄(κ°) μ¬μ©μμ μ°λ½μ²μ μ κ·Όνλ €κ³ ν©λλ€/],
|
210
|
+
["μΉμΈ", /μ΄(κ°) μ¬μ©μμ μΊλ¦°λμ μ κ·Όνλ €κ³ ν©λλ€/],
|
211
|
+
["μΉμΈ", /μ΄(κ°) μ¬μ©μμ 미리 μλ¦Όμ μ κ·Όνλ €κ³ ν©λλ€/],
|
212
|
+
["μΉμΈ", /μ΄(κ°) μ¬μ©μμ μ¬μ§μ μ κ·Όνλ €κ³ ν©λλ€/],
|
213
|
+
["μΉμΈ", /μ΄(κ°) μΉ΄λ©λΌμ μ κ·Όνλ €κ³ ν©λλ€/],
|
214
|
+
["μΉμΈ", /μμ Twitter κ³μ μ μ κ·Όνλ €κ³ ν©λλ€/],
|
215
|
+
["μΉμΈ", /μ΄(κ°) μ¬μ©μμ λμ λ° νΌνΈλμ€ νλμ μ κ·Όνλ €κ³ ν©λλ€/],
|
216
|
+
["μΉμΈ", "μ΄(κ°) λ§μ΄ν¬μ μ κ·Όνλ €κ³ ν©λλ€"],
|
217
|
+
["νμ©", "μμ μλ¦Όμ 보λ΄κ³ μ ν©λλ€"]
|
218
|
+
];
|
219
|
+
}
|
220
|
+
|
204
221
|
function localizations() {
|
205
222
|
return [].concat(
|
206
223
|
danishLocalizations(),
|
@@ -212,7 +229,8 @@ function localizations() {
|
|
212
229
|
russianLocalizations(),
|
213
230
|
spanishLocalizations(),
|
214
231
|
frenchLocalizations(),
|
215
|
-
portugueseBrazilLocalizations()
|
232
|
+
portugueseBrazilLocalizations(),
|
233
|
+
koreanLocalizations()
|
216
234
|
);
|
217
235
|
}
|
218
236
|
|
@@ -270,4 +288,3 @@ function isPrivacyAlert(alert) {
|
|
270
288
|
}
|
271
289
|
return false;
|
272
290
|
}
|
273
|
-
|
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.
|
4
|
+
version: 2.4.0
|
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:
|
12
|
+
date: 2017-04-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -45,20 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
49
|
-
- - ">="
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version: 3.0.1
|
48
|
+
version: '2.2'
|
52
49
|
type: :runtime
|
53
50
|
prerelease: false
|
54
51
|
version_requirements: !ruby/object:Gem::Requirement
|
55
52
|
requirements:
|
56
53
|
- - "~>"
|
57
54
|
- !ruby/object:Gem::Version
|
58
|
-
version: '
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 3.0.1
|
55
|
+
version: '2.2'
|
62
56
|
- !ruby/object:Gem::Dependency
|
63
57
|
name: thor
|
64
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -331,7 +325,6 @@ files:
|
|
331
325
|
- lib/run_loop/cli/cli.rb
|
332
326
|
- lib/run_loop/cli/codesign.rb
|
333
327
|
- lib/run_loop/cli/errors.rb
|
334
|
-
- lib/run_loop/cli/idm.rb
|
335
328
|
- lib/run_loop/cli/instruments.rb
|
336
329
|
- lib/run_loop/cli/locale.rb
|
337
330
|
- lib/run_loop/cli/simctl.rb
|
@@ -421,7 +414,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
421
414
|
- !ruby/object:Gem::Version
|
422
415
|
version: '0'
|
423
416
|
requirements: []
|
424
|
-
|
417
|
+
rubyforge_project:
|
418
|
+
rubygems_version: 2.5.1
|
425
419
|
signing_key:
|
426
420
|
specification_version: 4
|
427
421
|
summary: The bridge between Calabash iOS and Xcode command-line tools like instruments
|
data/lib/run_loop/cli/idm.rb
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
|
2
|
-
module RunLoop
|
3
|
-
module CLI
|
4
|
-
|
5
|
-
require 'thor'
|
6
|
-
class IDM < Thor
|
7
|
-
|
8
|
-
require "run_loop"
|
9
|
-
require "run_loop/cli/errors"
|
10
|
-
require "run_loop/shell"
|
11
|
-
include RunLoop::Shell
|
12
|
-
|
13
|
-
require "run_loop/regex"
|
14
|
-
|
15
|
-
desc "install app [OPTIONS]", "Installs an app on a device."
|
16
|
-
|
17
|
-
method_option "device",
|
18
|
-
:desc => 'The simulator UDID or name.',
|
19
|
-
:aliases => "-d",
|
20
|
-
:required => false,
|
21
|
-
:type => :string
|
22
|
-
|
23
|
-
method_option "debug",
|
24
|
-
:desc => "Enable debug logging.",
|
25
|
-
:aliases => "-v",
|
26
|
-
:required => false,
|
27
|
-
:default => false,
|
28
|
-
:type => :boolean
|
29
|
-
|
30
|
-
method_option "force",
|
31
|
-
:desc => "Force a re-install the existing app",
|
32
|
-
:aliases => "-f",
|
33
|
-
:required => false,
|
34
|
-
:default => false,
|
35
|
-
:type => :boolean
|
36
|
-
|
37
|
-
def install(app)
|
38
|
-
extension = File.extname(app)
|
39
|
-
if extension == ".app"
|
40
|
-
app_instance = RunLoop::App.new(app)
|
41
|
-
else
|
42
|
-
app_instance = RunLoop::Ipa.new(app)
|
43
|
-
end
|
44
|
-
|
45
|
-
xcode = RunLoop::Xcode.new
|
46
|
-
simctl = RunLoop::Simctl.new
|
47
|
-
instruments = RunLoop::Instruments.new
|
48
|
-
|
49
|
-
detect_options = {}
|
50
|
-
|
51
|
-
device = options[:device]
|
52
|
-
if !device
|
53
|
-
detect_options[:device] = "device"
|
54
|
-
else
|
55
|
-
detect_options[:device] = device
|
56
|
-
end
|
57
|
-
|
58
|
-
device = RunLoop::Device.detect_device(detect_options, xcode,
|
59
|
-
simctl, instruments)
|
60
|
-
|
61
|
-
idm = RunLoop::PhysicalDevice::IOSDeviceManager.new(device)
|
62
|
-
|
63
|
-
if options[:force]
|
64
|
-
idm.install_app(app_instance)
|
65
|
-
else
|
66
|
-
idm.ensure_newest_installed(app_instance)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|