smart_monkey 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/VERSION +1 -1
- data/lib/smart_monkey/command_helper.rb +18 -1
- data/lib/smart_monkey/monkey_runner.rb +6 -3
- data/lib/ui-auto-monkey/UIAutoMonkey.js +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5ddbe7279314292b43fa557cc7b04b52bb00cce
|
4
|
+
data.tar.gz: 0c43f1a91725bcc6775017c65f76100aa374c1f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bc77e9fa56e837a4a257f05d7d5b9bdae04f3b809176795330ac5e71b93ecf84d673f15165f38e71b0ae6a42d497593ab71917571adee9c31266b3c88a8e4e3
|
7
|
+
data.tar.gz: c3d6be6f49773bc7b6717e144c73ac5e71bb26a996ede8d19fd4ef964ac91bfa67e917454cb906b6af5a6e0c668e8cf4f3e44d484a27ea4bb0dc905c450f0690
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
@@ -4,6 +4,19 @@ module UIAutoMonkey
|
|
4
4
|
module CommandHelper
|
5
5
|
require 'open3'
|
6
6
|
|
7
|
+
def instruments_deviceinfo(device)
|
8
|
+
`"instruments" -s devices | grep "#{device}"`.strip
|
9
|
+
end
|
10
|
+
|
11
|
+
def is_simulator
|
12
|
+
deviceinfo = instruments_deviceinfo(device)
|
13
|
+
if deviceinfo.include? "-"
|
14
|
+
true
|
15
|
+
else
|
16
|
+
false
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
7
20
|
def shell(cmds)
|
8
21
|
puts "Shell: #{cmds.inspect}"
|
9
22
|
Open3.popen3(*cmds) do |stdin, stdout, stderr|
|
@@ -18,7 +31,11 @@ module UIAutoMonkey
|
|
18
31
|
# end
|
19
32
|
|
20
33
|
def relaunch_app(device,app)
|
21
|
-
|
34
|
+
if is_simulator
|
35
|
+
`xcrun simctl launch #{device} #{app} >/dev/null 2>&1 &`
|
36
|
+
else
|
37
|
+
`idevicedebug -u #{device} run #{app} >/dev/null 2>&1 &`
|
38
|
+
end
|
22
39
|
end
|
23
40
|
|
24
41
|
def run_process(cmds)
|
@@ -8,7 +8,6 @@ module UIAutoMonkey
|
|
8
8
|
require 'json'
|
9
9
|
|
10
10
|
class MonkeyRunner
|
11
|
-
TRACE_TEMPLATE='/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate'
|
12
11
|
RESULT_BASE_PATH = File.expand_path('smart_monkey_result')
|
13
12
|
INSTRUMENTS_TRACE_PATH = File.expand_path('*.trace')
|
14
13
|
TIME_STAP = Time.new.strftime("%Y%m%d%H%M%S")
|
@@ -82,9 +81,9 @@ module UIAutoMonkey
|
|
82
81
|
watch_syslog do
|
83
82
|
begin
|
84
83
|
unless time_limit_sec.nil?
|
85
|
-
run_process(%W(instruments -w #{device} -l #{time_limit} -t #{
|
84
|
+
run_process(%W(instruments -w #{device} -l #{time_limit} -t #{automation_template_path} #{app_path} -e UIASCRIPT #{ui_custom_path} -e UIARESULTSPATH #{result_base_dir}))
|
86
85
|
else
|
87
|
-
run_process(%W(instruments -w #{device} -t #{
|
86
|
+
run_process(%W(instruments -w #{device} -t #{automation_template_path} #{app_path} -e UIASCRIPT #{ui_custom_path} -e UIARESULTSPATH #{result_base_dir}))
|
88
87
|
end
|
89
88
|
rescue Timeout::Error
|
90
89
|
kill_all('instruments', '9')
|
@@ -413,6 +412,10 @@ module UIAutoMonkey
|
|
413
412
|
def xcode_path
|
414
413
|
`dirname #{xcode_developer_path}`.strip
|
415
414
|
end
|
415
|
+
|
416
|
+
def automation_template_path
|
417
|
+
`find #{xcode_path} -name Automation.tracetemplate`.strip
|
418
|
+
end
|
416
419
|
|
417
420
|
def symbolicatecrash_base_path()
|
418
421
|
`find #{xcode_path} -name symbolicatecrash`.strip
|