flaky 0.0.27 → 0.0.28

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb98852ea1697b910a4ec91dd228399f96e1107d
4
- data.tar.gz: 80993373a66b56bb78aa0929a9fe4fbe489df75e
3
+ metadata.gz: 86be210492db54b0da337ced2f1c1212d3410dee
4
+ data.tar.gz: 96177157c1513d4a6cba42ea2563753dcdf667b0
5
5
  SHA512:
6
- metadata.gz: e751fb9f7a6ea9466c153ebc122f429466d18072f8d140c740b8d28f917711eed2cf6407f8d5cfc7531f875523f93c230bcc1cbd4f9f1e6eb380dac01b850b20
7
- data.tar.gz: 8bfcfd7504e30a10a8612866ae0417a7574213e4416728b620ec5697b2d240eab54142fb306ec6a610cd69bcf15c5033649703add9dda28903b58646b1eb5cbe
6
+ metadata.gz: 6bbb7033d695786c5e4666ecbb5d5552d871ce2c26d46fbfa7867dc07ee6b22e31817a63f2c6db0338407d6cda48207365cd59e6ec03cb4b759db5472f39313b
7
+ data.tar.gz: 567c59a3397cb3afa19c5be35def7702a02499f5cc8feceb33a6f60a66cce17ce7ef351b1721f94dcf3fdf5ae36a53f87e26276c1ac5bbd10db0357d0ffa1e9d
data/lib/flaky.rb CHANGED
@@ -9,8 +9,8 @@ require 'posix/spawn' # http://rubygems.org/gems/posix-spawn
9
9
  require 'digest/md5'
10
10
 
11
11
  module Flaky
12
- VERSION = '0.0.27' unless defined? ::Flaky::VERSION
13
- DATE = '2014-01-18' unless defined? ::Flaky::DATE
12
+ VERSION = '0.0.28' unless defined? ::Flaky::VERSION
13
+ DATE = '2014-01-24' unless defined? ::Flaky::DATE
14
14
 
15
15
  class << self; attr_accessor :no_video; end
16
16
  self.no_video = false; # set default value
data/lib/flaky/appium.rb CHANGED
@@ -72,7 +72,7 @@ module Flaky
72
72
 
73
73
  def start
74
74
  self.stop # stop existing process
75
- @log = "/tmp/flaky/appium_tmp_log.txt"
75
+ @log = '/tmp/flaky/appium_tmp_log.txt'
76
76
  File.delete(@log) if File.exists? @log
77
77
 
78
78
  # appium should reset at startup
data/lib/flaky/run.rb CHANGED
@@ -138,7 +138,7 @@ module Flaky
138
138
  flaky_logs_txt = '/tmp/flaky_logs.txt'
139
139
  File.delete flaky_logs_txt if File.exist? flaky_logs_txt
140
140
  tail_cmd = "tail -f -n1 /Users/#{ENV['USER']}/Library/Logs/iOS\\ Simulator/7.0.3/system.log > #{flaky_logs_txt}"
141
- tail_cmd = "adb logcat > #{flaky_logs_txt}" if !appium.ios
141
+ tail_cmd = "adb logcat > #{flaky_logs_txt}" if !sauce && !appium.ios
142
142
 
143
143
  tail_system_log = Flaky::Cmd.new tail_cmd
144
144
  begin
@@ -267,6 +267,13 @@ module Flaky
267
267
  File.delete tmp_file if File.exists? tmp_file
268
268
  # also delete the temp ruby log
269
269
  File.delete tmp_ruby_log if File.exists? tmp_ruby_log
270
+
271
+ # copy app logs
272
+ app_logs = '/tmp/flaky_tmp_log_folder'
273
+ dest_dir = File.dirname(appium_server_path)
274
+ if File.exists? app_logs
275
+ Dir.glob(File.join(app_logs, '*')).each { |f| FileUtils.cp f, dest_dir }
276
+ end
270
277
  end
271
278
 
272
279
  passed
@@ -5,6 +5,23 @@ require 'posix-spawn'
5
5
  module Flaky
6
6
  class << self
7
7
 
8
+ # app_name for example MyApp.app
9
+ #
10
+ def capture_ios_app_log app_name
11
+ begin
12
+ app_glob = "/Users/#{ENV['USER']}/Library/Application Support/iPhone Simulator/7.0.3/Applications/*/#{app_name}"
13
+ app_folder = File.dirname Dir.glob(app_glob).first
14
+
15
+ tmp_log_folder = '/tmp/flaky_tmp_log_folder'
16
+ FileUtils.rm_rf tmp_log_folder if File.exists? tmp_log_folder
17
+ FileUtils.mkdir_p tmp_log_folder
18
+
19
+ log_glob = File.join app_folder, 'Library/Caches/Logs/*'
20
+ Dir.glob(log_glob).each { |log| FileUtils.cp log, tmp_log_folder }
21
+ rescue # folder may not exist. or there could be no longs
22
+ end
23
+ end
24
+
8
25
  def screen_recording_binary
9
26
  @screen_recording_binary ||= File.expand_path('../screen-recording', __FILE__)
10
27
  end
data/readme.md CHANGED
@@ -67,6 +67,7 @@ Run `flake auth` to automatically dismiss security dialogs.
67
67
  if $driver
68
68
  puts "Ending pid: #{flaky_screen_recording_pid}"
69
69
  Flaky.screen_recording_stop flaky_screen_recording_pid # save video
70
+ Flaky.capture_ios_app_log 'MyApp.app' # save app logs
70
71
  ignore { wait(10) { $driver.x } }
71
72
  end
72
73
  end
data/release_notes.md CHANGED
@@ -1,3 +1,9 @@
1
+ #### v0.0.27 2014-01-18
2
+
3
+ - [a342407](https://github.com/appium/flaky/commit/a342407388e8d8b5bdd09ba2293f2baa25f060b1) Release 0.0.27
4
+ - [410a64e](https://github.com/appium/flaky/commit/410a64ef7b39380418c84d77459d9a9355df27fa) Retry failed start after 60 seconds
5
+
6
+
1
7
  #### v0.0.26 2014-01-18
2
8
 
3
9
  - [844516a](https://github.com/appium/flaky/commit/844516a79eb5753aec263fc9fd88dd2fbda9147c) Release 0.0.26
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flaky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-18 00:00:00.000000000 Z
11
+ date: 2014-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic_duration