briar 0.0.5 → 0.0.6
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 +15 -0
- data/LICENSE.txt +1 -6
- data/README.md +8 -0
- data/bin/briar +44 -0
- data/bin/briar_helpers.rb +14 -0
- data/briar.gemspec +15 -12
- data/cucumber.yml.example +4 -0
- data/features/step_definitions/alerts_and_sheets/alert_view_steps.rb +3 -3
- data/features/step_definitions/bars/navbar_steps.rb +8 -8
- data/features/step_definitions/bars/tabbar_steps.rb +20 -14
- data/features/step_definitions/briar_core_steps.rb +3 -3
- data/features/step_definitions/control/button_steps.rb +10 -35
- data/features/step_definitions/email_steps.rb +55 -28
- data/features/step_definitions/keyboard_steps.rb +15 -2
- data/features/step_definitions/picker/date_picker_steps.rb +82 -68
- data/features/step_definitions/picker/picker_steps.rb +3 -3
- data/features/step_definitions/scroll_view_steps.rb +13 -12
- data/features/step_definitions/table_steps.rb +15 -10
- data/features/step_definitions/text_field_steps.rb +3 -3
- data/features/step_definitions/text_view_steps.rb +1 -7
- data/lib/briar.rb +2 -0
- data/lib/briar/alerts_and_sheets/alert_view.rb +17 -1
- data/lib/briar/bars/navbar.rb +16 -12
- data/lib/briar/bars/tabbar.rb +16 -4
- data/lib/briar/briar_core.rb +9 -3
- data/lib/briar/briar_steps.rb +19 -18
- data/lib/briar/control/button.rb +0 -1
- data/lib/briar/cucumber.rb +2 -0
- data/lib/briar/email.rb +34 -19
- data/lib/briar/keyboard.rb +25 -25
- data/lib/briar/picker/date_picker.rb +152 -107
- data/lib/briar/table.rb +18 -21
- data/lib/briar/version.rb +1 -1
- data/run-tests.sh +4 -0
- metadata +46 -20
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MmZiNDY2NzY2Nzc5N2NhYjVmZmE4NWJmYTFjY2YzMDFhZDc1NzE2ZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YmYwZjBiZDkxYjIxYTRhZjQ1ZmQ5YTFiZTc0NWFkNmVmNTY0NDEyMA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YmZlMTI3ZDU0MzI5N2YyNTE5M2YzZGU1NTk1M2M1ZDE3MzQ1YmVhOWNkOWEx
|
10
|
+
ZmUxYjkzNTQ3ZWFjNDk5ZmZlNmEzYjczMWFiMjRmNDY5YWJlZmVlZjJmODI3
|
11
|
+
OGNkMDMzZGQyYTFlMmJkM2I0YjczOWM0NDkxZjE1MGM0MjU5NDE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MjU2MjY0MzZhZTM4OTlkODE3YWZjYmExNDljNzM3NGZhOTM4Nzk3NTllOWY1
|
14
|
+
YjVkNTIyNTQ3N2I4Zjk5OWExNDZhZGMzOGM1MjQyMGQxYmE0YmM0OTg4M2Q1
|
15
|
+
ODlhNjc2NTA0NTUzM2ZmMTAxMjk1MjZlMTI2MjJhOWY1YTQ1ZjY=
|
data/LICENSE.txt
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
#
|
2
2
|
# ----------------------------------------------------------------------------
|
3
|
-
# "THE BEER-WARE LICENSE"
|
3
|
+
# "THE BEER-WARE LICENSE": As long as you retain this
|
4
4
|
# notice you can do whatever you want with this stuff. If we meet some
|
5
5
|
# day, and you think this stuff is worth it, you can buy me a beer in
|
6
6
|
# return.
|
7
7
|
# ----------------------------------------------------------------------------
|
8
8
|
#
|
9
|
-
#
|
10
9
|
# Copyright (c) 2010 Little Joy Software
|
11
10
|
# All rights reserved.
|
12
11
|
#
|
@@ -15,10 +14,6 @@
|
|
15
14
|
# met:
|
16
15
|
# * Redistributions of source code must retain the above copyright
|
17
16
|
# notice, this list of conditions and the following disclaimer.
|
18
|
-
# * Redistributions in binary form must reproduce the above copyright
|
19
|
-
# notice, this list of conditions and the following disclaimer in
|
20
|
-
# the documentation and/or other materials provided with the
|
21
|
-
# distribution.
|
22
17
|
# * Neither the name of the Little Joy Software nor the names of its
|
23
18
|
# contributors may be used to endorse or promote products derived
|
24
19
|
# from this software without specific prior written permission.
|
data/README.md
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
extends calabash-ios steps to provide steps for controlling complex ui
|
4
4
|
elements like tables and pickers.
|
5
5
|
|
6
|
+
https://github.com/calabash/calabash-ios.git
|
7
|
+
|
8
|
+
to see briar in action, have a look at
|
9
|
+
https://github.com/jmoody/briar-ios-example
|
10
|
+
|
11
|
+
i will try my best to follow http://semver.org/ when naming the
|
12
|
+
versions.
|
13
|
+
|
6
14
|
## Why briar?
|
7
15
|
|
8
16
|
* http://en.wikipedia.org/wiki/Smoking_pipe_(tobacco)#Calabash
|
data/bin/briar
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#http://tech.natemurray.com/2007/03/ruby-shell-commands.html
|
3
|
+
require 'find'
|
4
|
+
|
5
|
+
|
6
|
+
require File.join(File.dirname(__FILE__), 'briar_helpers')
|
7
|
+
|
8
|
+
if ARGV.length == 0
|
9
|
+
print_usage
|
10
|
+
exit 0
|
11
|
+
end
|
12
|
+
|
13
|
+
cmd = ARGV.shift
|
14
|
+
if cmd == 'help'
|
15
|
+
print_usage
|
16
|
+
exit 0
|
17
|
+
elsif cmd == BRIAR_RM_CAL_TARGETS
|
18
|
+
puts 'quiting the simulator'
|
19
|
+
`/usr/bin/osascript -e 'tell application "iPhone Simulator" to quit'`
|
20
|
+
sim_dir="#{ENV['HOME']}/Library/Application Support/iPhone Simulator"
|
21
|
+
|
22
|
+
# `find "#{sim_dir}" -type d -name '*-cal.app' | sed 's#\(.*\)/.*#\1#' | xargs -I{} rm -rf {}`
|
23
|
+
cal_targets = []
|
24
|
+
Find.find(sim_dir) do |path|
|
25
|
+
if path =~ /.*\-cal.app/
|
26
|
+
puts "found '#{File.basename(path)}' in '#{File.dirname(path)}'"
|
27
|
+
cal_targets << File.dirname(path)
|
28
|
+
Find.prune
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
if cal_targets.empty?
|
33
|
+
puts "found no *-cal.app targets in '#{sim_dir}'"
|
34
|
+
exit 0
|
35
|
+
end
|
36
|
+
|
37
|
+
cal_targets.each do |path|
|
38
|
+
FileUtils.rm_r path
|
39
|
+
end
|
40
|
+
|
41
|
+
else
|
42
|
+
print_usage
|
43
|
+
exit 1
|
44
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'briar'
|
2
|
+
|
3
|
+
BRIAR_RM_CAL_TARGETS='rm-cal-targets'
|
4
|
+
|
5
|
+
def print_usage
|
6
|
+
puts <<EOF
|
7
|
+
briar #{Briar::VERSION}
|
8
|
+
Usage: briar #{BRIAR_RM_CAL_TARGETS}
|
9
|
+
WARN: this is a destructive operation! you have been warned.
|
10
|
+
searches the ~/Library/Application Support/iPhone Simulator for *-cal.app
|
11
|
+
targets and deletes the enclosing directory. useful for clearing out old
|
12
|
+
calabash targets when the framework needs to be updated.
|
13
|
+
EOF
|
14
|
+
end
|
data/briar.gemspec
CHANGED
@@ -1,26 +1,29 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path(
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
3
|
#lib = File.expand_path('../lib', __FILE__)
|
4
4
|
#$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require 'briar/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |gem|
|
8
|
-
gem.name =
|
8
|
+
gem.name = 'briar'
|
9
9
|
gem.version = Briar::VERSION
|
10
|
-
gem.authors = [
|
11
|
-
gem.email = [
|
10
|
+
gem.authors = ['Joshua Moody']
|
11
|
+
gem.email = ['joshuajmoody@gmail.com']
|
12
12
|
gem.description = 'extends calabash-ios steps'
|
13
13
|
gem.summary = "briar-#{gem.version}"
|
14
|
-
gem.homepage =
|
15
|
-
|
16
|
-
gem.add_runtime_dependency 'calabash-cucumber'
|
17
|
-
|
18
|
-
gem.add_development_dependency 'rspec'
|
19
|
-
gem.add_development_dependency 'rvm'
|
14
|
+
gem.homepage = 'https://github.com/jmoody/briar'
|
15
|
+
gem.license = 'MIT'
|
20
16
|
|
17
|
+
gem.add_runtime_dependency 'calabash-cucumber' #, '0.9.138'
|
18
|
+
gem.add_runtime_dependency 'rake', '10.0.3'
|
19
|
+
gem.add_runtime_dependency 'bundler'
|
20
|
+
gem.add_runtime_dependency 'lesspainful'
|
21
|
+
gem.add_runtime_dependency 'rspec'
|
22
|
+
# rubymine is not picking up development dependencies in the gemspec
|
23
|
+
#gem.add_development_dependency 'rspec'
|
21
24
|
|
22
25
|
gem.files = `git ls-files`.split($/)
|
23
|
-
gem.executables =
|
26
|
+
gem.executables = 'briar'
|
24
27
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
25
|
-
gem.require_paths = [
|
28
|
+
gem.require_paths = ['lib']
|
26
29
|
end
|
@@ -0,0 +1,4 @@
|
|
1
|
+
default: NO_LAUNCH=1 OS=ios5 SCREENSHOT_PATH=./cucumber-screenshots/ -f 'Slowhandcuke::Formatter' -f rerun -o rerun.txt
|
2
|
+
slowhand: NO_LAUNCH=1 OS=ios5 SCREENSHOT_PATH=./cucumber-screenshots/ -f 'Slowhandcuke::Formatter' -f rerun -o rerun.txt
|
3
|
+
wip: NO_LAUNCH=1 OS=ios5 SCREENSHOT_PATH=./cucumber-screenshots/ -f 'Slowhandcuke::Formatter' -f rerun -o rerun.txt --tags @wip:3 --wip --require features
|
4
|
+
|
@@ -5,20 +5,20 @@ Then /^I should see alert with "([^"]*)" button$/ do |button_id|
|
|
5
5
|
end
|
6
6
|
|
7
7
|
Then /^I should see alert with title "([^"]*)"$/ do |title|
|
8
|
-
unless query(
|
8
|
+
unless query('alertView child label', :text).include?(title)
|
9
9
|
screenshot_and_raise "i do not see an alert view with title '#{title}'"
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
|
14
14
|
Then /^I should see alert with message "([^"]*)"$/ do |message|
|
15
|
-
unless query(
|
15
|
+
unless query('alertView child label', :text).include?(message)
|
16
16
|
screenshot_and_raise "i do not see an alert view with message '#{message}'"
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
Then /^I should not see an alert$/ do
|
21
|
-
res = query(
|
21
|
+
res = query('alertView')
|
22
22
|
unless res.empty?
|
23
23
|
screenshot_and_raise "i expected to see no alert view, but found '#{res}'"
|
24
24
|
end
|
@@ -12,7 +12,7 @@ end
|
|
12
12
|
# navigation back item, distinct from left bar button item
|
13
13
|
Then /^I should not see navbar back button$/ do
|
14
14
|
if navbar_has_back_button?
|
15
|
-
screenshot_and_raise
|
15
|
+
screenshot_and_raise 'there should be no navigation bar back button'
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -21,18 +21,18 @@ Then /^I touch navbar button "([^"]*)"$/ do |name|
|
|
21
21
|
end
|
22
22
|
|
23
23
|
Then /^I touch right navbar button$/ do
|
24
|
-
touch(
|
24
|
+
touch('navigationButton index:1')
|
25
25
|
step_pause
|
26
26
|
end
|
27
27
|
|
28
28
|
|
29
29
|
Then /^I should see navbar with title "([^\"]*)"$/ do |title|
|
30
|
-
|
30
|
+
should_see_navbar_with_title title
|
31
31
|
end
|
32
32
|
|
33
33
|
|
34
34
|
Then /^I should (not see|see) (?:the|an?) "([^"]*)" button in the navbar$/ do |visibility, name|
|
35
|
-
if visibility.eql?
|
35
|
+
if visibility.eql? 'see'
|
36
36
|
should_see_navbar_button name
|
37
37
|
else
|
38
38
|
should_not_see_navbar_button name
|
@@ -64,7 +64,7 @@ Then /^I touch the "([^"]*)" navbar button$/ do |name|
|
|
64
64
|
end
|
65
65
|
|
66
66
|
Then /^I should see that the navbar has title "([^"]*)"$/ do |title|
|
67
|
-
|
67
|
+
should_see_navbar_with_title title
|
68
68
|
end
|
69
69
|
|
70
70
|
Then /^I touch the "([^"]*)" button in the navbar$/ do |name|
|
@@ -78,7 +78,7 @@ Then /^I should see a back button in the navbar with the title "([^"]*)"$/ do |t
|
|
78
78
|
end
|
79
79
|
|
80
80
|
When /^I go back, I should see the "([^"]*)" view$/ do |view_id|
|
81
|
-
touch_transition(
|
81
|
+
touch_transition('navigationItemButtonView first',
|
82
82
|
"view marked:'#{view_id}'",
|
83
83
|
{:timeout=>TOUCH_TRANSITION_TIMEOUT,
|
84
84
|
:retry_frequency=>TOUCH_TRANSITION_RETRY_FREQ})
|
@@ -87,9 +87,9 @@ end
|
|
87
87
|
Then /^I should see today's date in the navbar$/ do
|
88
88
|
now = Time.now
|
89
89
|
unless date_is_in_navbar(now)
|
90
|
-
with_leading = now.strftime(
|
90
|
+
with_leading = now.strftime('%a %b %d')
|
91
91
|
without_leading = now.strftime("%a %b #{date.day}")
|
92
92
|
screenshot_and_raise "could not find #{with_leading} or #{without_leading} " +
|
93
|
-
|
93
|
+
'in the date bar'
|
94
94
|
end
|
95
95
|
end
|
@@ -1,27 +1,25 @@
|
|
1
|
-
#include Briar::Bars
|
2
|
-
|
3
|
-
Then /^I should see tabbar button "([^"]*)" at index (\d+)$/ do |name, index|
|
4
|
-
unless tabbar_item_is_at_index(name, index)
|
5
|
-
screenshot_and_raise "tabbar button with name #{name} does not exist at index " +
|
6
|
-
index.to_s
|
7
|
-
end
|
8
|
-
end
|
9
1
|
|
10
2
|
Given /^that the tabbar is visible$/ do
|
3
|
+
pending "deprecated 0.0.5 - use 'Then I should see the tabbar'"
|
11
4
|
should_see_tabbar
|
12
5
|
end
|
13
6
|
|
7
|
+
Then /^the tabbar is visible$/ do
|
8
|
+
pending "deprecated 0.0.5 - use 'Then I should see the tabbar'"
|
9
|
+
macro 'that the tabbar is visible'
|
10
|
+
end
|
11
|
+
|
14
12
|
|
15
|
-
Then /^I should not see the tabbar$/ do
|
16
|
-
|
13
|
+
Then /^I should( not)? see the (?:tabbar|tab bar)$/ do |visibility|
|
14
|
+
visibility ? should_not_see_tabbar : should_see_tabbar
|
17
15
|
end
|
18
16
|
|
19
|
-
Then
|
20
|
-
|
17
|
+
Then /^I should see (?:tabbar|tab bar) button "([^"]*)" at index (\d+)$/ do |name, index|
|
18
|
+
should_see_tab_at_index name, index
|
21
19
|
end
|
22
20
|
|
23
|
-
Then
|
24
|
-
|
21
|
+
Then /I touch (?:the) "([^"]*)" tab$/ do |name|
|
22
|
+
touch_tabbar_item name
|
25
23
|
end
|
26
24
|
|
27
25
|
When /^I touch the "([^"]*)" tab I should see the "([^"]*)" view$/ do |tab_label, view_id|
|
@@ -30,3 +28,11 @@ When /^I touch the "([^"]*)" tab I should see the "([^"]*)" view$/ do |tab_label
|
|
30
28
|
should_see_view_after_animation view_id
|
31
29
|
end
|
32
30
|
|
31
|
+
Then /^I should see "([^"]*)" tabs$/ do |list_of_tabs|
|
32
|
+
tabs = list_of_tabs.split(/,\s?/)
|
33
|
+
index = 0
|
34
|
+
tabs.each do |tab|
|
35
|
+
should_see_tab_at_index tab.strip! || tab, index
|
36
|
+
index = index + 1
|
37
|
+
end
|
38
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
#include Briar::Core
|
2
2
|
|
3
3
|
Then /^I should (see|not see) (?:the|) "([^\"]*)" view$/ do |visibility, view_id|
|
4
|
-
if visibility.eql?
|
5
|
-
|
4
|
+
if visibility.eql? 'see'
|
5
|
+
should_see_view view_id
|
6
6
|
else
|
7
|
-
|
7
|
+
should_not_see_view view_id
|
8
8
|
end
|
9
9
|
end
|
@@ -1,56 +1,31 @@
|
|
1
|
-
#include Briar::Control::Button
|
2
1
|
|
3
|
-
|
4
|
-
should_see_button name
|
5
|
-
unless button_is_enabled name
|
6
|
-
screenshot_and_raise "i did not see that #{name} was enabled"
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
Then /^I should see button "([^\"]*)" is disabled$/ do |name|
|
11
|
-
should_see_button name
|
12
|
-
if button_is_enabled name
|
13
|
-
screenshot_and_raise "i did not see that #{name} was disabled"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
Then /^I touch "([^"]*)" button$/ do |name|
|
18
|
-
touch_button name
|
19
|
-
end
|
20
|
-
|
21
|
-
When /^I touch the "([^"]*)" button, then I should see the "([^"]*)" view$/ do |button_id, view_id|
|
2
|
+
When /^I touch (?:the|a) "([^"]*)" button, then I should see the "([^"]*)" view$/ do |button_id, view_id|
|
22
3
|
touch_transition("button marked:'#{button_id}'",
|
23
4
|
"view marked:'#{view_id}'",
|
24
5
|
{:timeout=>TOUCH_TRANSITION_TIMEOUT,
|
25
6
|
:retry_frequency=>TOUCH_TRANSITION_RETRY_FREQ})
|
26
7
|
end
|
27
8
|
|
28
|
-
Then /^I touch the "([^"]*)" button and wait for (?:the|a) "([^"]*)" view$/ do |button_id, view_id|
|
9
|
+
Then /^I touch (?:the|a) "([^"]*)" button and wait for (?:the|a) "([^"]*)" view$/ do |button_id, view_id|
|
29
10
|
touch_transition("button marked:'#{button_id}'",
|
30
11
|
"view marked:'#{view_id}'",
|
31
12
|
{:timeout=>TOUCH_TRANSITION_TIMEOUT,
|
32
13
|
:retry_frequency=>TOUCH_TRANSITION_RETRY_FREQ})
|
33
14
|
end
|
34
15
|
|
35
|
-
Then /^I should see the "([^"]*)" button has title "([^"]*)"$/ do |button_id, title|
|
16
|
+
Then /^I should see (?:the|a) "([^"]*)" button has title "([^"]*)"$/ do |button_id, title|
|
36
17
|
should_see_button_with_title button_id, title
|
37
18
|
end
|
38
19
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
Then /^I should see "([^"]*)" button$/ do |button_id|
|
46
|
-
unless button_exists? button_id
|
47
|
-
screenshot_and_raise "should see button '#{button_id}'"
|
48
|
-
end
|
20
|
+
# as of 0.9.136 - I should (not)? see a ... button
|
21
|
+
# conflicts with calabash predefined steps
|
22
|
+
Then /^I should( not)? see (?:the|an) "([^"]*)" button$/ do |visibility, button_id|
|
23
|
+
visibility ? should_not_see_button(button_id) : should_see_button(button_id)
|
49
24
|
end
|
50
25
|
|
51
|
-
Then /^I should see the "([^"]*)" button is (disabled|enabled)$/ do |button_id, state|
|
52
|
-
res = query("button marked:'
|
53
|
-
str_state = state.eql?(
|
26
|
+
Then /^I should see (?:the|a) "([^"]*)" button is (disabled|enabled)$/ do |button_id, state|
|
27
|
+
res = query("button marked:'#{button_id}'", :isEnabled).first
|
28
|
+
str_state = state.eql?('disabled') ? '0' : '1'
|
54
29
|
unless res.eql?(str_state)
|
55
30
|
screenshot_and_raise "expected to see '#{button_id}' that is '#{state}' but found '#{res}'"
|
56
31
|
end
|
@@ -1,10 +1,17 @@
|
|
1
|
-
#include Briar::Email
|
2
|
-
#include Briar::Core
|
3
1
|
|
2
|
+
#noinspection RubyUnusedLocalVariable
|
4
3
|
Then /^I should see email body that contains "([^"]*)"$/ do |text|
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
pending "deprecated 0.0.6 - use 'Then I should see email view with body that contains \"#{text}\"'"
|
5
|
+
end
|
6
|
+
|
7
|
+
Then /^I should see email view with body that contains "([^"]*)"$/ do |text|
|
8
|
+
if gestalt.is_ios6?
|
9
|
+
puts 'WARN: iOS6 detected - cannot test for email views on iOS simulator or devices'
|
10
|
+
else
|
11
|
+
wait_for_animation
|
12
|
+
unless email_body_contains? text
|
13
|
+
screenshot_and_raise "expected to see email body containing '#{text} but found '#{email_body}'"
|
14
|
+
end
|
8
15
|
end
|
9
16
|
end
|
10
17
|
|
@@ -12,48 +19,68 @@ Then /^I touch the "([^"]*)" row and wait to see the email view$/ do |row_id|
|
|
12
19
|
should_see_row row_id
|
13
20
|
touch("tableViewCell marked:'#{row_id}'")
|
14
21
|
wait_for_animation
|
15
|
-
|
22
|
+
if gestalt.is_ios6?
|
23
|
+
puts 'WARN: iOS6 detected - cannot test for email views on iOS simulator or devices'
|
24
|
+
else
|
25
|
+
should_see_mail_view
|
26
|
+
end
|
16
27
|
end
|
17
28
|
|
18
29
|
Then /^I should see email view with "([^"]*)" in the subject$/ do |text|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
30
|
+
if gestalt.is_ios6?
|
31
|
+
puts 'WARN: iOS6 detected - cannot test for email views on iOS simulator or devices'
|
32
|
+
else
|
33
|
+
wait_for_animation
|
34
|
+
should_see_mail_view
|
35
|
+
unless email_subject_is? text
|
36
|
+
screenshot_and_raise "expected to see '#{text}' in the email subject but found '#{email_subject}'"
|
37
|
+
end
|
23
38
|
end
|
24
39
|
end
|
25
40
|
|
26
|
-
Then /^I should see email view with
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
41
|
+
Then /^I should see email view with recipients? "([^"]*)"$/ do |comma_sep_addrs|
|
42
|
+
if gestalt.is_ios6?
|
43
|
+
puts 'WARN: iOS6 detected - cannot test for email views on iOS simulator or devices'
|
44
|
+
else
|
45
|
+
should_see_mail_view
|
46
|
+
wait_for_animation
|
47
|
+
addrs = comma_sep_addrs.split(/, ?/)
|
48
|
+
addrs.each do |expected|
|
49
|
+
unless email_to_contains? expected.strip
|
50
|
+
screenshot_and_raise "expected to see '#{expected}' in the email 'to' field but found '#{email_to}'"
|
51
|
+
end
|
52
|
+
end
|
32
53
|
end
|
33
54
|
end
|
34
55
|
|
35
|
-
|
36
|
-
|
37
|
-
|
56
|
+
#noinspection RubyUnusedLocalVariable
|
57
|
+
Then /^I should see email view with to field set to "([^"]*)"$/ do |text|
|
58
|
+
pending "deprecated 0.0.6 - use 'Then I should see email view with recipients \"#{text}\"'"
|
59
|
+
end
|
38
60
|
|
39
|
-
|
40
|
-
|
41
|
-
|
61
|
+
Then /^I should see email view with text like "([^"]*)" in the subject$/ do |text|
|
62
|
+
if gestalt.is_ios6?
|
63
|
+
puts 'WARN: iOS6 detected - cannot test for email views on iOS simulator or devices'
|
64
|
+
else
|
65
|
+
should_see_mail_view
|
66
|
+
wait_for_animation
|
67
|
+
unless email_subject_has_text_like? text
|
68
|
+
screenshot_and_raise "expected to see '#{text}' in the email subject but found '#{email_subject}'"
|
69
|
+
end
|
42
70
|
end
|
43
71
|
end
|
44
72
|
|
45
73
|
When /^I cancel email editing I should see the "([^"]*)" view$/ do |view_id|
|
46
|
-
should_see_mail_view
|
47
|
-
wait_for_animation
|
48
|
-
|
49
74
|
if gestalt.is_ios6?
|
50
|
-
puts
|
75
|
+
puts 'WARN: iOS6 detected - cannot test for email views on iOS simulator or devices'
|
51
76
|
else
|
52
|
-
|
77
|
+
should_see_mail_view
|
78
|
+
wait_for_animation
|
79
|
+
touch_navbar_item 'Cancel'
|
53
80
|
wait_for_animation
|
54
81
|
touch_transition("button marked:'Delete Draft'",
|
55
82
|
"view marked:'#{view_id}'",
|
56
83
|
{:timeout=>TOUCH_TRANSITION_TIMEOUT,
|
57
|
-
:retry_frequency=>
|
84
|
+
:retry_frequency=>TOUCH_TRANSITION_RETRY_FREQ})
|
58
85
|
end
|
59
86
|
end
|