briar 0.1.3.b6 → 0.1.3.b7
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 +4 -4
- data/README.md +1 -1
- data/briar.gemspec +15 -2
- data/lib/briar.rb +12 -8
- data/lib/briar/alerts_and_sheets/action_sheet.rb +4 -4
- data/lib/briar/alerts_and_sheets/alert_view.rb +4 -4
- data/lib/briar/briar_core.rb +1 -1
- data/lib/briar/control/segmented_control.rb +2 -2
- data/lib/briar/cucumber.rb +4 -1
- data/lib/briar/email.rb +3 -3
- data/lib/briar/keyboard/keyboard.rb +0 -2
- data/lib/briar/label.rb +1 -1
- data/lib/briar/picker/date_picker.rb +1 -1
- data/lib/briar/picker/picker_shared.rb +7 -3
- data/lib/briar/table.rb +0 -7
- data/lib/briar/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64cfb8af1d1f6f49f08a52b1ad05ddea03652fa6
|
4
|
+
data.tar.gz: 153e16ff005812af6f6f7c6442ff1b169ad86a2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eba1da164fd5b0d7e2f58c5a36432ea7a2119bc8f581be538c97aa21339868df381fa47dd9ac45108ec0f7500f8a555d0c1a01bb4b5fea38d47cdb0c05aa7021
|
7
|
+
data.tar.gz: 181817f3977856a0d2b9cb30171d1a77d42733be2e081275559987bf74ac1988f290ba61fab7de6ac4a218de5985fd59ee0b3f29a6adb42785cf3c4410be8b42
|
data/README.md
CHANGED
data/briar.gemspec
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
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.
|
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'
|
data/lib/briar.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
#$:.unshift File.dirname(__FILE__)
|
2
2
|
|
3
|
-
|
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
|
-
|
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
|
-
#
|
19
|
-
#
|
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
|
-
#
|
23
|
-
#
|
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?
|
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
|
18
|
-
unless sheet_exists?
|
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?
|
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 =
|
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
|
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
|
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
|
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
|
data/lib/briar/briar_core.rb
CHANGED
@@ -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
|
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
|
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
|
data/lib/briar/cucumber.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
require '
|
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
|
|
data/lib/briar/email.rb
CHANGED
@@ -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
|
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
|
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
|
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']}
|
data/lib/briar/label.rb
CHANGED
@@ -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
|
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(
|
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
|
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
|
32
|
+
query("pickerTableView index:'#{column}'", [{:selectRow => new_row},
|
33
|
+
{:animated => 1},
|
34
|
+
{:notify => 1}])
|
31
35
|
end
|
32
36
|
end
|
33
37
|
end
|
data/lib/briar/table.rb
CHANGED
@@ -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?
|
data/lib/briar/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
162
|
+
summary: briar-0.1.3.b7
|
149
163
|
test_files:
|
150
164
|
- spec/spec_helper.rb
|