briar 0.1.4.b1 → 0.1.4.b2

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: f2de2d2410ddc9524589489604312c5b4a6512f1
4
- data.tar.gz: 548da4584b0f8fbafa8d5fae39b469bef887cbfe
3
+ metadata.gz: 62fe6beab3ccafca8f63ed1495401e1fd87fd655
4
+ data.tar.gz: 6640a39a83872ad212563db4d509519fa37a5b0f
5
5
  SHA512:
6
- metadata.gz: cc2e61cae457c7343a72fbccf4ba67491c786aea152734873dcda30419268e508c28eec564c6cf2a2eb7656fd0eb7c5beca0e3102190516644177720142b6b02
7
- data.tar.gz: 62857537e5d132f602138a1f0cad5790e303edbd19914e9da6cfbb71ba656fece8025d2fe8759f93cd5768d61161f58c29d4ec538784872f748e9e4f6c0cea3e
6
+ metadata.gz: 98f0247ebb873a2ff6f5d253512e9d472ed0fe349bf2c9217c618c89a97838572ae9ca8ee29732679a2988c464b773a2ab0db0d5eb66c7e069990eb109c0cf4e
7
+ data.tar.gz: 8593a9acd379968e2a26d08fd9e7c014e82f39f2cb10aa33985ef005d47a98293520e71b3a53b7f5888207da00bbdb7df6625615500a379f2fd55fd066b1579b
data/lib/briar.rb CHANGED
@@ -97,4 +97,12 @@ if RUBY_VERSION.start_with?('1.8')
97
97
  end
98
98
 
99
99
  end
100
+
101
+ class Array
102
+
103
+ def sample(*args)
104
+ self.choice(args)
105
+ end
106
+
107
+ end
100
108
  end
@@ -19,7 +19,18 @@ module Briar
19
19
  end
20
20
 
21
21
  def navbar_has_back_button?
22
- !query('navigationItemButtonView').empty?
22
+ res = query('navigationItemButtonView')
23
+ return false if res.empty?
24
+
25
+ # sometime the back button is there, but has zero rect
26
+ frame = res.first['frame']
27
+
28
+ ['x', 'y', 'width', 'height'].each { |key|
29
+ if frame[key] != 0
30
+ return true
31
+ end
32
+ }
33
+ false
23
34
  end
24
35
 
25
36
  def should_see_navbar_back_button
@@ -74,21 +85,33 @@ module Briar
74
85
  end
75
86
 
76
87
 
77
- def should_not_see_navbar_button (name, is_ui_button=false)
78
- if is_ui_button
79
- qstr = "buttonLabel marked:'#{name}' parent navigationBar"
80
- timeout = 1.0
81
- msg = "waited for '#{timeout}' seconds but i still see '#{name}' in navigation bar"
88
+ # todo convert args to hash and mirror the should_see_navbar_button
89
+ #is_ui_button=false)
90
+ def should_not_see_navbar_button (mark, opts={})
91
+ if (not opts.is_a?(Hash)) and (not opts.nil?)
92
+ warn "\nWARN: deprecated 0.1.4 - you should no longer pass a Boolean '#{opts}' as an arg, pass opts hash instead"
93
+ button_type = opts ? :button : :bar_item
94
+ opts = {:bar_button_type => button_type}
95
+ end
96
+ default_opts = {:bar_button_type => :bar_item,
97
+ :timeout => BRIAR_WAIT_TIMEOUT}
98
+ opts = default_opts.merge(opts)
99
+ if opts[:bar_button_type] == :button
100
+ queries = ["buttonLabel marked:'#{mark}' parent navigationBar",
101
+ "button marked:'#{mark}' parent navigationBar"]
102
+ timeout = opts[:timeout]
103
+ msg = "waited for '#{timeout}' seconds but i still see '#{mark}' in navigation bar"
82
104
  wait_for(:timeout => timeout,
83
105
  :retry_frequency => BRIAR_WAIT_RETRY_FREQ,
84
106
  :post_timeout => BRIAR_WAIT_STEP_PAUSE,
85
107
  :timeout_message => msg) do
86
- element_does_not_exist qstr
108
+ queries.all? { |query| element_does_not_exist query }
87
109
  end
88
110
  else
89
- idx = index_of_navbar_button name
111
+ idx = index_of_navbar_button mark
90
112
  unless idx.nil?
91
- screenshot_and_raise "i should not see a navbar button named #{name}"
113
+ # check to see if it is a ui button
114
+ should_not_see_navbar_button mark, {:bar_button_type => :button}
92
115
  end
93
116
  end
94
117
  end
data/lib/briar/email.rb CHANGED
@@ -82,20 +82,20 @@ module Briar
82
82
 
83
83
  def should_see_mail_view (opts = {:timeout => BRIAR_WAIT_TIMEOUT,
84
84
  :email_view_mark => 'compose email'})
85
-
86
- {:timeout => BRIAR_WAIT_TIMEOUT, :email_view_mark => 'compose email'}.merge!(opts)
87
-
85
+ default_opts = {:timeout => BRIAR_WAIT_TIMEOUT,
86
+ :email_view_mark => 'compose email'}
87
+ merged = default_opts.merge(opts)
88
88
 
89
89
  if email_not_testable?
90
90
  warn_about_no_ios5_email_view
91
91
  return
92
92
  end
93
93
 
94
- timeout = opts[:timeout]
94
+ timeout = merged[:timeout]
95
95
  msg = "waited for '#{timeout}' seconds but did not see email compose view"
96
96
  #noinspection RubyParenthesesAfterMethodCallInspection
97
97
 
98
- email_view_mark = opts[:email_view_mark]
98
+ email_view_mark = merged[:email_view_mark]
99
99
  wait_for(:timeout => timeout,
100
100
  :retry_frequency => BRIAR_WAIT_RETRY_FREQ,
101
101
  :post_timeout => BRIAR_WAIT_STEP_PAUSE,
@@ -69,8 +69,10 @@ module Briar
69
69
 
70
70
 
71
71
  #noinspection RubyUnusedLocalVariable
72
- def briar_clear_text(view_id, timeout=5)
73
- _deprecated('0.1.1', "will remove 'timeout' argument in a future release", :warn)
72
+ def briar_clear_text(view_id, timeout=nil)
73
+ unless timeout.nil?
74
+ _deprecated('0.1.1', "will remove 'timeout' argument in a future release", :warn)
75
+ end
74
76
  clear_text("view marked:'#{view_id}'")
75
77
 
76
78
  # i really wanted this to work, but there are too many issues with the
data/lib/briar/table.rb CHANGED
@@ -152,7 +152,9 @@ module Briar
152
152
 
153
153
  def briar_scroll_to_row_and_touch (row_id, opts={})
154
154
  if (not opts.is_a?(Hash)) and (not opts.nil?)
155
- warn "WARN: deprecated 0.1.3 - you should no longer pass a view_id '#{opts}' as an arg, pass opts hash instead"
155
+ _deprecated('0.1.3',
156
+ "you should no longer pass a view_id '#{opts}' as an arg, pass opts hash instead",
157
+ :warn)
156
158
  opts = {:wait_for_id => opts}
157
159
  end
158
160
 
data/lib/briar/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Briar
2
- VERSION = '0.1.4.b1'
2
+ VERSION = '0.1.4.b2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: briar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.b1
4
+ version: 0.1.4.b2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Moody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-19 00:00:00.000000000 Z
11
+ date: 2014-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbx-require-relative
@@ -227,6 +227,7 @@ rubyforge_project:
227
227
  rubygems_version: 2.2.2
228
228
  signing_key:
229
229
  specification_version: 4
230
- summary: briar-0.1.4.b1
230
+ summary: briar-0.1.4.b2
231
231
  test_files:
232
232
  - spec/spec_helper.rb
233
+ has_rdoc: