flaky 0.0.9 → 0.0.10

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: e7bf49cdc404dc8ebcfbb87cfa847214c2b72ef8
4
- data.tar.gz: 6430385f049b8ec4d445517e69e8c0cc7e76c2eb
3
+ metadata.gz: 9a63c4ad161f24050b143495c2d447548bd3583b
4
+ data.tar.gz: f5c2a7d10f2af9cf34eb8c9bd1e7b9d1f3d568d1
5
5
  SHA512:
6
- metadata.gz: fdbb065bfa4f671b4aa6c8667215b02ee84619839e88c07e96fa9c4509e6658667a2d90054a8205051ca407b07bbf67b8766602010c7b8ab8d2b8e1d8358c120
7
- data.tar.gz: 7e427af15ac21b289282dd5e7832b7e85f9fa3b52ddc240e090311d7de373412ba9ffcfd23885d95ff822c2e0406cae7432a9a8ea4e7e67c3d80b9cc456c0921
6
+ metadata.gz: 64bd3e9a77a1ddd312a466cfcf5c78216eaa4e216e2eb00676c6034306810067e443662ce1c94e9baeff235833e1e65389eec0a8bd664901d1b3ef9d1168e5aa
7
+ data.tar.gz: ac60f293ec06da455c75de8083aec98ad82aa2257816dafe8de3433deeedb382e119a8326ead0f4bde8c164124c06818f8f64c1fb5fa1aa19234c817649934dd
@@ -0,0 +1,26 @@
1
+ -- Code from https://github.com/penguinho/appium-old/blob/master/appium/template/BeatSecurityAgent.applescript
2
+ -- Examples:
3
+ -- $ osascript BeatSecurityAgent.applescript jason s3cr3t
4
+
5
+ on run argv
6
+ set the_username to item 1 of argv
7
+ set the_password to item 2 of argv
8
+
9
+ repeat
10
+ try
11
+ set procs to ""
12
+ tell application "System Events"
13
+ set procs to name of every process
14
+ end tell
15
+ if procs contains "SecurityAgent" then
16
+ tell application "System Events"
17
+ tell process "SecurityAgent" to set value of text field 1 of scroll area 1 of group 1 of window 1 to the_username
18
+ tell process "SecurityAgent" to set value of text field 2 of scroll area 1 of group 1 of window 1 to the_password
19
+ click button 2 of group 2 of window 1 of application process "SecurityAgent"
20
+ log ("Dismissed Security Dialog")
21
+ end tell
22
+ end if
23
+ end try
24
+ delay 1
25
+ end repeat
26
+ end run
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.9' unless defined? ::Flaky::VERSION
13
- DATE = '2013-10-21' unless defined? ::Flaky::DATE
12
+ VERSION = '0.0.10' unless defined? ::Flaky::VERSION
13
+ DATE = '2013-11-01' unless defined? ::Flaky::DATE
14
14
 
15
15
  # https://github.com/appium/ruby_lib/blob/0e203d76610abd519ba9d2fe9c14b50c94df5bbd/lib/appium_lib.rb#L24
16
16
  def self.add_to_path file, path=false
data/lib/flaky/appium.rb CHANGED
@@ -22,6 +22,7 @@ module Flaky
22
22
  # logcat is read & stopped by run.execute
23
23
  attr_reader :ready, :pid, :in, :out, :err, :log, :tail, :logcat
24
24
  @@thread = nil
25
+ @@osascript = nil
25
26
 
26
27
  def self.remove_ios_apps
27
28
  user = ENV['USER']
@@ -57,6 +58,17 @@ module Flaky
57
58
  if @android
58
59
  @droid = Flaky::Android.new
59
60
  @logcat = Flaky::Logcat.new
61
+ else # dismiss iOS auth dialogs
62
+ @@osascript = Thread.new do
63
+ Thread.current.abort_on_exception = true
64
+ flaky_password = ENV['FLAKY_PASSWORD']
65
+ raise 'FLAKY_PASSWORD must be defined' if flaky_password.nil? || flaky_password.empty?
66
+ flaky_user = ENV['FLAKY_USER']
67
+ raise 'FLAKY_USER must be defined' if flaky_user.nil? || flaky_user.empty?
68
+
69
+ script = File.expand_path('../../BeatSecurityAgent.applescript', __FILE__)
70
+ Cmd.new("/usr/bin/osascript #{script} #{flaky_user} #{flaky_password}")
71
+ end unless @@osascript
60
72
  end
61
73
  end
62
74
 
@@ -68,7 +80,7 @@ module Flaky
68
80
  @droid.reset
69
81
  @logcat.start
70
82
  else
71
- self.class.remove_ios_apps
83
+ self.class.remove_ios_apps
72
84
  end
73
85
 
74
86
  @@thread.exit if @@thread
data/lib/flaky/run.rb CHANGED
@@ -54,6 +54,8 @@ module Flaky
54
54
  puts "\n" * 2
55
55
  success = ''
56
56
  failure = ''
57
+ total_success = 0
58
+ total_failure = 0
57
59
  @tests.each do |name, stats|
58
60
  runs = stats[:runs]
59
61
  pass = stats[:pass]
@@ -62,14 +64,16 @@ module Flaky
62
64
  " fail: #{fail}\n"
63
65
  if fail > 0 && pass <= 0
64
66
  failure += line
67
+ total_failure += 1
65
68
  else
66
69
  success += line
70
+ total_success += 1
67
71
  end
68
72
  end
69
73
 
70
- out = ''
71
- out += "Failure:\n#{failure}\n" unless failure.empty?
72
- out += "Success:\n#{success}" unless success.empty?
74
+ out = "#{total_success + total_failure} Tests\n\n"
75
+ out += "Failure (#{total_failure}):\n#{failure}\n" unless failure.empty?
76
+ out += "Success (#{total_success}):\n#{success}" unless success.empty?
73
77
 
74
78
  duration = Time.now - @start_time
75
79
  duration = ChronicDuration.output(duration.round) || '0s'
data/release_notes.md CHANGED
@@ -1,3 +1,10 @@
1
+ #### v0.0.9 2013-10-21
2
+
3
+ - [2e8faf8](https://github.com/appium/flaky/commit/2e8faf8aadf71d61f327e5e587c625345b5a62d6) Release 0.0.9
4
+ - [f03f4b6](https://github.com/appium/flaky/commit/f03f4b65ae80a6b8c528aadd962c07c5460b8790) Failure is 0 success
5
+ - [24ece72](https://github.com/appium/flaky/commit/24ece72fc9554b6dd3eb94823e87694b06fe05af) Store test results in folders
6
+
7
+
1
8
  #### v0.0.8 2013-10-17
2
9
 
3
10
  - [ed116e9](https://github.com/appium/flaky/commit/ed116e92698360e9e587b27df054888efdcda3d1) Release 0.0.8
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.9
4
+ version: 0.0.10
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: 2013-10-21 00:00:00.000000000 Z
11
+ date: 2013-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chronic_duration
@@ -78,6 +78,7 @@ files:
78
78
  - Rakefile
79
79
  - bin/flake
80
80
  - flaky.gemspec
81
+ - lib/BeatSecurityAgent.applescript
81
82
  - lib/flaky.rb
82
83
  - lib/flaky/appium.rb
83
84
  - lib/flaky/log.rb