briar 0.1.3.b6 → 0.1.3.b7

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: d47641a74475402a7cfb4cc6a7693cdff83477e0
4
- data.tar.gz: 26d1f06f4739a772aa599b507811838cd34d95f6
3
+ metadata.gz: 64cfb8af1d1f6f49f08a52b1ad05ddea03652fa6
4
+ data.tar.gz: 153e16ff005812af6f6f7c6442ff1b169ad86a2b
5
5
  SHA512:
6
- metadata.gz: 099614b3ee8a07ae8c790ee5d866bfc5710db0a28453c838dae80ad08d9f222f8642cece6d0181840aef0768e42dd1733e264ee9772d07d48aaae9c5e40f7bf7
7
- data.tar.gz: 8e51149e59fd615ee0df09d827ead49ad8217d20bc317b5adcab906fa1f43f9bda5b6dbb8010bab6e33cf31f694882060807720931b38cd49f34658fd8cb79d6
6
+ metadata.gz: eba1da164fd5b0d7e2f58c5a36432ea7a2119bc8f581be538c97aa21339868df381fa47dd9ac45108ec0f7500f8a555d0c1a01bb4b5fea38d47cdb0c05aa7021
7
+ data.tar.gz: 181817f3977856a0d2b9cb30171d1a77d42733be2e081275559987bf74ac1988f290ba61fab7de6ac4a218de5985fd59ee0b3f29a6adb42785cf3c4410be8b42
data/README.md CHANGED
@@ -15,7 +15,7 @@ DRY: I have several iOS projects that use calabash-cucumber and I found I was re
15
15
 
16
16
  ## Installation
17
17
 
18
- Requires ruby >= 1.9.2
18
+ Requires ruby >= 1.8.7; ruby 2.0 is recommended.
19
19
 
20
20
  In your Gemfile:
21
21
 
@@ -1,5 +1,16 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require_relative 'lib/briar/version'
2
+
3
+ # ==> require_relative 'lib/briar/version' <==
4
+ # bundler on 1.9.3 complains
5
+ # 'Does it try to require a relative path? That's been removed in Ruby 1.9'
6
+ #
7
+ # this is the current _best_ solution
8
+ $:.push File.expand_path("../lib", __FILE__)
9
+ require 'briar/version'
10
+
11
+ # experimental
12
+ # not yet
13
+ # $:.push File.expand_path("../features", __FILE__)
3
14
 
4
15
  Gem::Specification.new do |gem|
5
16
  gem.name = 'briar'
@@ -11,8 +22,10 @@ Gem::Specification.new do |gem|
11
22
  gem.homepage = 'https://github.com/jmoody/briar'
12
23
  gem.license = 'MIT'
13
24
 
14
- gem.required_ruby_version = Gem::Requirement.new('>= 1.9.2')
25
+ gem.platform = Gem::Platform::RUBY
26
+ gem.required_ruby_version = '>= 1.8.7'
15
27
 
28
+ gem.add_runtime_dependency 'rbx-require-relative', "~> 0.0.9"
16
29
  gem.add_runtime_dependency 'calabash-cucumber', '>= 0.9.164'
17
30
  gem.add_runtime_dependency 'rake', '~>10.1'
18
31
  gem.add_runtime_dependency 'syntax', '~>1.2'
@@ -1,11 +1,11 @@
1
1
  #$:.unshift File.dirname(__FILE__)
2
2
 
3
- DEVICE_ENDPOINT = (ENV['DEVICE_ENDPOINT'] || 'http://localhost:37265')
4
-
5
- # will deprecate soon
3
+ # will deprecate soon (starting 0.1.3)
6
4
  TOUCH_TRANSITION_TIMEOUT = 30.0
7
5
  TOUCH_TRANSITION_RETRY_FREQ = 0.5
8
- ANIMATION_PAUSE = (ENV['ANIMATION_PAUSE'] || 0.6).to_f
6
+
7
+ # deprecated 0.1.3
8
+ # ANIMATION_PAUSE = (ENV['ANIMATION_PAUSE'] || 0.6).to_f
9
9
 
10
10
  # see below for replacements
11
11
  BRIAR_RETRY_FREQ=0.1
@@ -15,12 +15,16 @@ BRIAR_POST_TIMEOUT=0.5
15
15
  BRIAR_STEP_PAUSE = (ENV['STEP_PAUSE'] || 0.5).to_f
16
16
 
17
17
  # we need an insanely long time out because of some changes in 0.9.163
18
- # the waits succeed after a short amount of time (visually < 1 sec),
19
- # but fail if the wait time out is too short (4s)
18
+ #
19
+ # the waits succeed after a short amount of time (visually < 1 sec), but fail if
20
+ # the wait time out is too short (4s)
21
+ #
20
22
  # 8 seconds works most of the time
21
23
  # 10 seconds seems safe
22
- # the problem with a long time out is that during development you want the
23
- # tests to fail fast.
24
+ # 14 seconds is safe
25
+ #
26
+ # the problem with a long time out is that during development you want the tests
27
+ # to fail fast.
24
28
  BRIAR_WAIT_TIMEOUT = (ENV['WAIT_TIMEOUT'] || 14.0).to_f
25
29
  BRIAR_WAIT_RETRY_FREQ = (ENV['RETRY_FREQ'] || 0.1).to_f
26
30
 
@@ -10,12 +10,12 @@ module Briar
10
10
  end
11
11
  end
12
12
 
13
- def sheet_exists? (sheet_id)
13
+ def sheet_exists?(sheet_id)
14
14
  !query(query_str_for_sheet sheet_id).empty?
15
15
  end
16
16
 
17
- def should_see_sheet (sheet_id, button_titles=nil, sheet_title=nil)
18
- unless sheet_exists? (sheet_id)
17
+ def should_see_sheet(sheet_id, button_titles=nil, sheet_title=nil)
18
+ unless sheet_exists?(sheet_id)
19
19
  screenshot_and_raise "should see sheet marked '#{sheet_id}'"
20
20
  end
21
21
 
@@ -29,7 +29,7 @@ module Briar
29
29
  end
30
30
 
31
31
  def should_not_see_sheet(sheet_id)
32
- if sheet_exists? (sheet_id)
32
+ if sheet_exists?(sheet_id)
33
33
  screenshot_and_raise "should not see sheet marked '#{sheet_id}'"
34
34
  end
35
35
  end
@@ -9,7 +9,7 @@ module Briar
9
9
 
10
10
  def alert_exists? (alert_id=nil)
11
11
  if uia_available?
12
- res = send_uia_command command: 'uia.alert() != null'
12
+ res = uia('uia.alert() != null')
13
13
  res['value']
14
14
  else
15
15
  if alert_id.nil?
@@ -47,7 +47,7 @@ module Briar
47
47
  msg = "waited for '#{timeout}' but did not see an alert"
48
48
  opts = wait_opts(msg, timeout)
49
49
  wait_for(opts) do
50
- not uia_query(:view, marked: "#{title}").empty?
50
+ not uia_query(:view, {:marked => "#{title}"}).empty?
51
51
  end
52
52
  else
53
53
  qstr = 'alertView child label'
@@ -63,7 +63,7 @@ module Briar
63
63
  if ios7?
64
64
  warn 'WARN: cannot distinguish between alert titles and messages'
65
65
  should_see_alert
66
- if uia_query(:view, marked: "#{message}").empty?
66
+ if uia_query(:view, {:marked => "#{message}"}).empty?
67
67
  screenshot_and_raise "expected to see alert with title '#{message}'"
68
68
  end
69
69
  else
@@ -81,7 +81,7 @@ module Briar
81
81
  def alert_button_exists? (button_id)
82
82
  if uia_available?
83
83
  should_see_alert
84
- not uia_query(:view, marked: "#{button_id}").empty?
84
+ not uia_query(:view, {:marked => "#{button_id}"}).empty?
85
85
  else
86
86
  query('alertView child button child label', :text).include?(button_id)
87
87
  end
@@ -13,7 +13,7 @@ module Briar
13
13
 
14
14
  def wait_for_animation
15
15
  _deprecated('0.1.3', "use any of the 'wait_*' functions instead", :warn)
16
- sleep(ANIMATION_PAUSE)
16
+ sleep(0.6)
17
17
  end
18
18
 
19
19
  def view_exists? (view_id)
@@ -22,7 +22,7 @@ module Briar
22
22
  num_segs = query(qstr, :numberOfSegments).first.to_i
23
23
  idx = 0
24
24
  while idx < num_segs
25
- title = query(qstr, {titleForSegmentAtIndex: idx}).first
25
+ title = query(qstr, {:titleForSegmentAtIndex => idx}).first
26
26
  return idx if title.eql?(segment_id)
27
27
  idx = idx + 1
28
28
  end
@@ -61,7 +61,7 @@ module Briar
61
61
  tokens.each do |expected|
62
62
  idx = index_of_segment_with_name_in_control_with_id expected, control_id
63
63
  unless idx == counter
64
- actual = query("segmentedControl marked:'#{control_id}'", {titleForSegmentAtIndex: counter}).first
64
+ actual = query("segmentedControl marked:'#{control_id}'", {:titleForSegmentAtIndex => counter}).first
65
65
  screenshot_and_raise "expected to see segment '#{expected}' at index '#{counter}' but found '#{actual}'"
66
66
  end
67
67
  counter = counter + 1
@@ -1,4 +1,6 @@
1
- require 'briar'
1
+ require 'require_relative'
2
+
3
+ require_relative '../briar'
2
4
 
3
5
  World(Briar)
4
6
  World(Briar::Core)
@@ -26,6 +28,7 @@ World(Briar::Table)
26
28
  World(Briar::TextField)
27
29
  World(Briar::TextView)
28
30
 
31
+
29
32
  require_relative '../../features/step_definitions/alerts_and_sheets/action_sheet_steps'
30
33
  require_relative '../../features/step_definitions/alerts_and_sheets/alert_view_steps'
31
34
 
@@ -153,7 +153,7 @@ module Briar
153
153
  :retry_frequency => BRIAR_WAIT_RETRY_FREQ,
154
154
  :post_timeout => BRIAR_WAIT_STEP_PAUSE,
155
155
  :timeout_message => msg) do
156
- uia_element_exists?(:view, marked: 'Cancel')
156
+ uia_element_exists?(:view, {:marked => 'Cancel'})
157
157
  end
158
158
 
159
159
  uia_tap_mark('Cancel')
@@ -162,7 +162,7 @@ module Briar
162
162
  :retry_frequency => BRIAR_WAIT_RETRY_FREQ,
163
163
  :post_timeout => BRIAR_WAIT_STEP_PAUSE,
164
164
  :timeout_message => msg) do
165
- uia_element_exists?(:view, marked: 'Delete Draft')
165
+ uia_element_exists?(:view, {:marked => 'Delete Draft'})
166
166
  end
167
167
 
168
168
  uia_tap_mark('Delete Draft')
@@ -180,7 +180,7 @@ module Briar
180
180
  screenshot_and_raise 'UIA needs to be available'
181
181
  end
182
182
 
183
- res = uia_query(:view, marked: 'To:').first
183
+ res = uia_query(:view, {:marked => 'To:'}).first
184
184
  rect = res['rect']
185
185
  point = {:x => rect['x'] + (2 * rect['width']),
186
186
  :y => rect['y']}
@@ -2,8 +2,6 @@ require 'calabash-cucumber'
2
2
 
3
3
  module Briar
4
4
  module Keyboard
5
- # dismiss the keyboard on iPad
6
- # send_uia_command command:"uia.keyboard().buttons()['Hide keyboard'].tap()"
7
5
 
8
6
  UITextAutocapitalizationTypeNone = 0
9
7
  UITextAutocapitalizationTypeWords = 1
@@ -7,7 +7,7 @@ module Briar
7
7
  end
8
8
 
9
9
  def should_see_label (name)
10
- res = label_exists? (name)
10
+ res = label_exists?(name)
11
11
  unless res
12
12
  screenshot_and_raise "i could not find label with access id #{name}"
13
13
  end
@@ -46,7 +46,7 @@ module Briar
46
46
 
47
47
  def change_minute_interval_on_picker (target_interval, picker_id=nil)
48
48
  query_str = should_see_date_picker picker_id
49
- res = query(query_str, [{setMinuteInterval: target_interval.to_i}])
49
+ res = query(query_str, [{:setMinuteInterval => target_interval.to_i}])
50
50
  if res.empty?
51
51
  screenshot_and_raise "could not change the minute interval with query '#{query_str}'"
52
52
  end
@@ -3,7 +3,7 @@ require 'calabash-cucumber'
3
3
  module Briar
4
4
  module Picker_Shared
5
5
  def picker_current_index_for_column (column)
6
- arr = query("pickerTableView", :selectionBarRow)
6
+ arr = query('pickerTableView', :selectionBarRow)
7
7
  arr[column]
8
8
  end
9
9
  # methods common to generic and date pickers
@@ -22,12 +22,16 @@ module Briar
22
22
  def picker_scroll_down_on_column(column)
23
23
  new_row = previous_index_for_column column
24
24
  #scroll_to_row("pickerTableView index:#{column}", new_row)
25
- query("pickerTableView index:'#{column}'", [{selectRow:new_row}, {animated:1}, {notify:1}])
25
+ query("pickerTableView index:'#{column}'", [{:selectRow => new_row},
26
+ {:animated => 1},
27
+ {:notify => 1}])
26
28
  end
27
29
 
28
30
  def picker_scroll_up_on_column(column)
29
31
  new_row = picker_next_index_for_column column
30
- query("pickerTableView index:'#{column}'", [{selectRow:new_row}, {animated:1}, {notify:1}])
32
+ query("pickerTableView index:'#{column}'", [{:selectRow => new_row},
33
+ {:animated => 1},
34
+ {:notify => 1}])
31
35
  end
32
36
  end
33
37
  end
@@ -27,13 +27,6 @@ module Briar
27
27
  "tableView marked:'#{table_id}'"
28
28
  end
29
29
 
30
- def table_has_calabash_additions
31
- success_value = '1'
32
- res = query('tableView', [{hasCalabashAdditions: success_value}])
33
- screenshot_and_raise 'table is not visible' if res.empty?
34
- res.first.eql? success_value
35
- end
36
-
37
30
  def row_visible? (row_id, table_id = nil)
38
31
  query_str = query_str_for_row row_id, table_id
39
32
  !query(query_str, AI).empty?
@@ -1,3 +1,3 @@
1
1
  module Briar
2
- VERSION = '0.1.3.b6'
2
+ VERSION = '0.1.3.b7'
3
3
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: briar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.b6
4
+ version: 0.1.3.b7
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-01-14 00:00:00.000000000 Z
11
+ date: 2014-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rbx-require-relative
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.9
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.9
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: calabash-cucumber
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -134,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
148
  requirements:
135
149
  - - '>='
136
150
  - !ruby/object:Gem::Version
137
- version: 1.9.2
151
+ version: 1.8.7
138
152
  required_rubygems_version: !ruby/object:Gem::Requirement
139
153
  requirements:
140
154
  - - '>'
@@ -145,6 +159,6 @@ rubyforge_project:
145
159
  rubygems_version: 2.2.1
146
160
  signing_key:
147
161
  specification_version: 4
148
- summary: briar-0.1.3.b6
162
+ summary: briar-0.1.3.b7
149
163
  test_files:
150
164
  - spec/spec_helper.rb