briar 0.0.8 → 0.0.9
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 +9 -9
- data/README.md +15 -17
- data/bin/briar +94 -55
- data/bin/briar_helpers.rb +18 -5
- data/bin/briar_resign.rb +272 -0
- data/briar.gemspec +3 -6
- data/cucumber.yml.example +20 -3
- data/features/step_definitions/briar_core_steps.rb +1 -1
- data/features/step_definitions/control/button_steps.rb +1 -1
- data/features/step_definitions/control/slider_steps.rb +2 -0
- data/features/step_definitions/email_steps.rb +12 -12
- data/features/step_definitions/keyboard_steps.rb +1 -0
- data/features/step_definitions/label_steps.rb +1 -1
- data/features/step_definitions/picker/date_picker_steps.rb +22 -3
- data/features/step_definitions/table_steps.rb +17 -6
- data/features/step_definitions/text_view_steps.rb +4 -10
- data/lib/briar.rb +10 -1
- data/lib/briar/alerts_and_sheets/action_sheet.rb +2 -2
- data/lib/briar/alerts_and_sheets/alert_view.rb +78 -19
- data/lib/briar/bars/navbar.rb +56 -20
- data/lib/briar/briar_core.rb +80 -9
- data/lib/briar/control/button.rb +16 -19
- data/lib/briar/email.rb +88 -30
- data/lib/briar/keyboard.rb +40 -40
- data/lib/briar/label.rb +1 -3
- data/lib/briar/picker/date_picker.rb +9 -1
- data/lib/briar/picker/date_picker_manipulation.rb +2 -2
- data/lib/briar/table.rb +56 -25
- data/lib/briar/text_field.rb +6 -4
- data/lib/briar/text_view.rb +33 -8
- data/lib/briar/version.rb +1 -1
- metadata +6 -34
- data/install-calabash-framework.sh.example +0 -10
data/lib/briar/bars/navbar.rb
CHANGED
@@ -23,8 +23,13 @@ module Briar
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def should_see_navbar_back_button
|
26
|
-
|
27
|
-
|
26
|
+
timeout = BRIAR_WAIT_TIMEOUT * 2.0
|
27
|
+
msg = "waited for '#{timeout}' seconds but did not see navbar back button"
|
28
|
+
wait_for(:timeout => timeout,
|
29
|
+
:retry_frequency => 0.2,
|
30
|
+
:post_timeout => 0.1,
|
31
|
+
:timeout_message => msg) do
|
32
|
+
navbar_has_back_button?
|
28
33
|
end
|
29
34
|
end
|
30
35
|
|
@@ -41,17 +46,43 @@ module Briar
|
|
41
46
|
titles.index(name)
|
42
47
|
end
|
43
48
|
|
44
|
-
def should_see_navbar_button (name)
|
45
|
-
|
46
|
-
|
47
|
-
|
49
|
+
def should_see_navbar_button (name, is_ui_button=false)
|
50
|
+
if is_ui_button
|
51
|
+
qstr = "button marked:'#{name}' parent navigationBar"
|
52
|
+
timeout = BRIAR_WAIT_TIMEOUT
|
53
|
+
msg = "waited for '#{timeout}' seconds but did not see '#{name}' in navigation bar"
|
54
|
+
wait_for(:timeout => timeout,
|
55
|
+
:retry_frequency => 0.2,
|
56
|
+
:post_timeout => 0.1,
|
57
|
+
:timeout_message => msg) do
|
58
|
+
element_exists qstr
|
59
|
+
end
|
60
|
+
else
|
61
|
+
idx = index_of_navbar_button name
|
62
|
+
if idx.nil?
|
63
|
+
# check to see if it is a ui button
|
64
|
+
should_see_navbar_button(name, true)
|
65
|
+
end
|
48
66
|
end
|
49
67
|
end
|
50
68
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
69
|
+
|
70
|
+
def should_not_see_navbar_button (name, is_ui_button=false)
|
71
|
+
if is_ui_button
|
72
|
+
qstr = "button marked:'#{name}' parent navigationBar"
|
73
|
+
timeout = 1.0
|
74
|
+
msg = "waited for '#{timeout}' seconds but i still see '#{name}' in navigation bar"
|
75
|
+
wait_for(:timeout => timeout,
|
76
|
+
:retry_frequency => 0.2,
|
77
|
+
:post_timeout => 0.1,
|
78
|
+
:timeout_message => msg) do
|
79
|
+
element_does_not_exist qstr
|
80
|
+
end
|
81
|
+
else
|
82
|
+
idx = index_of_navbar_button name
|
83
|
+
unless idx.nil?
|
84
|
+
screenshot_and_raise "i should not see a navbar button named #{name}"
|
85
|
+
end
|
55
86
|
end
|
56
87
|
end
|
57
88
|
|
@@ -82,8 +113,8 @@ module Briar
|
|
82
113
|
|
83
114
|
touch_transition('navigationItemButtonView first',
|
84
115
|
"view marked:'#{view}'",
|
85
|
-
{:timeout=>TOUCH_TRANSITION_TIMEOUT,
|
86
|
-
:retry_frequency=>TOUCH_TRANSITION_RETRY_FREQ})
|
116
|
+
{:timeout => TOUCH_TRANSITION_TIMEOUT,
|
117
|
+
:retry_frequency => TOUCH_TRANSITION_RETRY_FREQ})
|
87
118
|
step_pause
|
88
119
|
end
|
89
120
|
|
@@ -113,15 +144,20 @@ module Briar
|
|
113
144
|
touch_navbar_item item_name, view_id
|
114
145
|
end
|
115
146
|
|
116
|
-
|
117
147
|
def navbar_has_title? (title)
|
118
|
-
|
119
|
-
query('
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
148
|
+
all_items = query("navigationItemView marked:'#{title}'")
|
149
|
+
button_items = query('navigationItemButtonView')
|
150
|
+
non_button_items = all_items.delete_if { |item| button_items.include?(item) }
|
151
|
+
!non_button_items.empty?
|
152
|
+
end
|
153
|
+
|
154
|
+
def should_see_navbar_with_title(title, timeout=BRIAR_WAIT_TIMEOUT)
|
155
|
+
msg = "waited for '#{timeout}' seconds but i did not see #{title} in navbar"
|
156
|
+
wait_for(:timeout => timeout,
|
157
|
+
:retry_frequency => 0.2,
|
158
|
+
:post_timeout => 0.1,
|
159
|
+
:timeout_message => msg) do
|
160
|
+
navbar_has_title? title
|
125
161
|
end
|
126
162
|
end
|
127
163
|
|
data/lib/briar/briar_core.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'calabash-cucumber'
|
2
2
|
|
3
|
-
|
4
3
|
module Briar
|
5
4
|
module Core
|
6
5
|
|
@@ -12,6 +11,13 @@ module Briar
|
|
12
11
|
sleep(ANIMATION_PAUSE)
|
13
12
|
end
|
14
13
|
|
14
|
+
def uia_not_available
|
15
|
+
env('NO_LAUNCH') == '1'
|
16
|
+
end
|
17
|
+
|
18
|
+
def uia_available
|
19
|
+
not uia_not_available
|
20
|
+
end
|
15
21
|
|
16
22
|
def view_exists? (view_id)
|
17
23
|
!query("view marked:'#{view_id}'").empty?
|
@@ -33,6 +39,31 @@ module Briar
|
|
33
39
|
element_exists("view text:'#{text}'")
|
34
40
|
end
|
35
41
|
|
42
|
+
def should_see_view_with_frame(view_id, frame)
|
43
|
+
res = query("view marked:'#{view_id}'").first
|
44
|
+
if res.empty?
|
45
|
+
screenshot_and_raise "should see view with id '#{view_id}'"
|
46
|
+
end
|
47
|
+
actual = res['frame']
|
48
|
+
['x', 'y', 'width', 'height'].each { |key|
|
49
|
+
avalue = actual[key]
|
50
|
+
evalue = frame[key]
|
51
|
+
screenshot_and_raise "#{view_id} should have '#{key}' '#{evalue}' but found '#{avalue}'"
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
def should_see_view_with_center(view_id, center_ht)
|
56
|
+
res = query("view marked:'#{view_id}'").first
|
57
|
+
if res.nil?
|
58
|
+
screenshot_and_raise "should see view with id '#{view_id}'"
|
59
|
+
end
|
60
|
+
|
61
|
+
actual_ht = {x: res['rect']['center_x'], y: res['rect']['center_y']}
|
62
|
+
|
63
|
+
unless actual_ht == center_ht
|
64
|
+
screenshot_and_raise "#{view_id} has center '#{actual_ht}' but should have center '#{center_ht}'"
|
65
|
+
end
|
66
|
+
end
|
36
67
|
|
37
68
|
def should_see_view_after_animation (view_id)
|
38
69
|
pending "WARN: deprecated 0.0.8 - use 'wait_for_view #{view_id}' instead"
|
@@ -51,25 +82,59 @@ module Briar
|
|
51
82
|
end
|
52
83
|
|
53
84
|
def touch_view_named(view_id)
|
85
|
+
wait_for_view view_id
|
54
86
|
touch("view marked:'#{view_id}'")
|
55
87
|
end
|
56
88
|
|
57
|
-
def touch_and_wait_for_view(view_id, view_to_wait_for, timeout=
|
89
|
+
def touch_and_wait_for_view(view_id, view_to_wait_for, timeout=BRIAR_WAIT_TIMEOUT)
|
58
90
|
touch_view_named(view_id)
|
59
91
|
wait_for_view(view_to_wait_for, timeout)
|
60
92
|
end
|
61
93
|
|
62
|
-
def wait_for_view (view_id, timeout=
|
94
|
+
def wait_for_view (view_id, timeout=BRIAR_WAIT_TIMEOUT)
|
63
95
|
msg = "waited for '#{timeout}' seconds but did not see '#{view_id}'"
|
64
96
|
wait_for(:timeout => timeout,
|
65
97
|
:retry_frequency => 0.2,
|
66
98
|
:post_timeout => 0.1,
|
67
|
-
:timeout_message => msg
|
99
|
+
:timeout_message => msg) do
|
68
100
|
view_exists? view_id
|
69
101
|
end
|
70
102
|
end
|
71
103
|
|
72
|
-
def
|
104
|
+
def wait_for_query(qstr, timeout=BRIAR_WAIT_TIMEOUT)
|
105
|
+
msg = "waited for '#{timeout}' seconds but did not see\n '#{qstr}'"
|
106
|
+
wait_for(:timeout => timeout,
|
107
|
+
:retry_frequency => 0.2,
|
108
|
+
:post_timeout => 0.1,
|
109
|
+
:timeout_message => msg) do
|
110
|
+
!query(qstr).empty?
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def wait_for_custom_view (view_class, view_id, timeout=BRIAR_WAIT_TIMEOUT)
|
115
|
+
msg = "waited for '#{timeout}' seconds but did not see '#{view_id}'"
|
116
|
+
wait_for(:timeout => timeout,
|
117
|
+
:retry_frequency => 0.2,
|
118
|
+
:post_timeout => 0.1,
|
119
|
+
:timeout_message => msg) do
|
120
|
+
!query("view:'#{view_class}' marked:'#{view_id}'").empty?
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def touch_custom_view(view_class, view_id, timeout=BRIAR_WAIT_TIMEOUT)
|
125
|
+
wait_for_custom_view view_class, view_id, timeout
|
126
|
+
touch("view:'#{view_class}' marked:'#{view_id}'")
|
127
|
+
end
|
128
|
+
|
129
|
+
|
130
|
+
def touch_custom_view_and_wait_for_view(view_class, view_id, view_to_wait_for, timeout=BRIAR_WAIT_TIMEOUT)
|
131
|
+
wait_for_custom_view view_class, view_id, timeout
|
132
|
+
touch("view:'#{view_class}' marked:'#{view_id}'")
|
133
|
+
wait_for_view view_to_wait_for, timeout
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
def wait_for_views(views, timeout=BRIAR_WAIT_TIMEOUT)
|
73
138
|
msg = "waited for '#{timeout}' seconds but did not see '#{views}'"
|
74
139
|
options = {:timeout => timeout,
|
75
140
|
:retry_frequency => 0.2,
|
@@ -80,7 +145,7 @@ module Briar
|
|
80
145
|
end
|
81
146
|
end
|
82
147
|
|
83
|
-
def wait_for_view_to_disappear(view_id, timeout=
|
148
|
+
def wait_for_view_to_disappear(view_id, timeout=BRIAR_WAIT_TIMEOUT)
|
84
149
|
msg = "waited for '#{timeout}' seconds for '#{view_id}' to disappear but it is still visible"
|
85
150
|
options = {:timeout => timeout,
|
86
151
|
:retry_frequency => 0.2,
|
@@ -91,12 +156,12 @@ module Briar
|
|
91
156
|
end
|
92
157
|
end
|
93
158
|
|
94
|
-
|
95
|
-
def touch_and_wait_to_disappear(view_id, timeout=1.0)
|
159
|
+
def touch_and_wait_to_disappear(view_id, timeout=BRIAR_WAIT_TIMEOUT)
|
96
160
|
touch_view_named(view_id)
|
97
161
|
wait_for_view_to_disappear view_id, timeout
|
98
162
|
end
|
99
|
-
|
163
|
+
|
164
|
+
|
100
165
|
# backdoor helpers
|
101
166
|
# canonical backdoor command: 'calabash_backdoor_handle_command'
|
102
167
|
# selector key = :selector
|
@@ -111,6 +176,12 @@ module Briar
|
|
111
176
|
json = "{\":selector\" : \"#{command}\", \":args\" : #{array}}"
|
112
177
|
backdoor('calabash_backdoor_handle_command:', json)
|
113
178
|
end
|
179
|
+
|
180
|
+
def tokenize_list (list)
|
181
|
+
tokens = list.split(/[,]|(and )/)
|
182
|
+
stripped = tokens.map { |elm| elm.strip }
|
183
|
+
stripped.delete_if { |elm| ['and', 'or', ''].include?(elm) }
|
184
|
+
end
|
114
185
|
end
|
115
186
|
end
|
116
187
|
|
data/lib/briar/control/button.rb
CHANGED
@@ -4,8 +4,8 @@ module Briar
|
|
4
4
|
module Control
|
5
5
|
module Button
|
6
6
|
include Briar::Core
|
7
|
-
def button_exists? (
|
8
|
-
res = query("button marked:'#{
|
7
|
+
def button_exists? (button_id)
|
8
|
+
res = query("button marked:'#{button_id}'", :alpha)
|
9
9
|
if res.empty?
|
10
10
|
false
|
11
11
|
else
|
@@ -13,10 +13,8 @@ module Briar
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def should_see_button (
|
17
|
-
|
18
|
-
screenshot_and_raise "i did not see a button with marked #{name}"
|
19
|
-
end
|
16
|
+
def should_see_button (button_id)
|
17
|
+
wait_for_button button_id
|
20
18
|
end
|
21
19
|
|
22
20
|
def should_not_see_button (button_id)
|
@@ -30,31 +28,30 @@ module Briar
|
|
30
28
|
|
31
29
|
def should_see_button_with_title(name, title)
|
32
30
|
should_see_button name
|
33
|
-
if query("button marked:'#{
|
34
|
-
screenshot_and_raise "i do not see a button marked #{name} with title #{title}"
|
31
|
+
if query("button marked:'#{name}' child label", :text).empty?
|
32
|
+
screenshot_and_raise "i do not see a button marked '#{name}' with title '#{title}'"
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|
38
|
-
def touch_button (
|
39
|
-
should_see_button
|
40
|
-
touch("button marked:'#{
|
41
|
-
step_pause
|
36
|
+
def touch_button (button_id)
|
37
|
+
should_see_button button_id
|
38
|
+
touch("button marked:'#{button_id}'")
|
42
39
|
end
|
43
40
|
|
44
41
|
def touch_button_and_wait_for_view (button_id, view_id)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
42
|
+
touch_button(button_id)
|
43
|
+
unless view_id.nil?
|
44
|
+
wait_for_view view_id
|
45
|
+
end
|
49
46
|
end
|
50
47
|
|
51
|
-
def touch_button_and_wait_for_view_to_disappear (button_id, view_id, timeout=
|
48
|
+
def touch_button_and_wait_for_view_to_disappear (button_id, view_id, timeout=BRIAR_WAIT_TIMEOUT)
|
52
49
|
touch_button button_id
|
53
50
|
wait_for_view_to_disappear view_id, timeout
|
54
51
|
end
|
55
52
|
|
56
53
|
|
57
|
-
def wait_for_button (button_id, timeout=
|
54
|
+
def wait_for_button (button_id, timeout=BRIAR_WAIT_TIMEOUT)
|
58
55
|
msg = "waited for '#{timeout}' seconds but did not see button '#{button_id}'"
|
59
56
|
wait_for(:timeout => timeout,
|
60
57
|
:retry_frequency => 0.2,
|
@@ -64,7 +61,7 @@ module Briar
|
|
64
61
|
end
|
65
62
|
end
|
66
63
|
|
67
|
-
def wait_for_button_with_title (button_id, title, timeout=
|
64
|
+
def wait_for_button_with_title (button_id, title, timeout=BRIAR_WAIT_TIMEOUT)
|
68
65
|
msg = "waited for '#{timeout}' seconds but did not see button '#{button_id}' with title '#{title}'"
|
69
66
|
wait_for(:timeout => timeout,
|
70
67
|
:retry_frequency => 0.2,
|
data/lib/briar/email.rb
CHANGED
@@ -3,8 +3,17 @@ require 'calabash-cucumber'
|
|
3
3
|
module Briar
|
4
4
|
module Email
|
5
5
|
|
6
|
-
def
|
7
|
-
|
6
|
+
def email_testable?
|
7
|
+
return true if device.ios5?
|
8
|
+
uia_available?
|
9
|
+
end
|
10
|
+
|
11
|
+
def email_not_testable?
|
12
|
+
not email_testable?()
|
13
|
+
end
|
14
|
+
|
15
|
+
def warn_about_no_ios5_email_view
|
16
|
+
warn 'WARN: iOS > 5 detected - cannot test for email views on iOS simulator or devices unless we use UIAutomation'
|
8
17
|
end
|
9
18
|
|
10
19
|
def email_body
|
@@ -12,10 +21,10 @@ module Briar
|
|
12
21
|
end
|
13
22
|
|
14
23
|
def email_body_contains? (text)
|
15
|
-
if device.
|
16
|
-
warn 'WARN: iOS6 detected - cannot test for email body text https://groups.google.com/d/topic/calabash-ios/Ff3XFsjp-B0/discussion'
|
17
|
-
else
|
24
|
+
if device.ios5?
|
18
25
|
!query("view:'MFComposeTextContentView' {text LIKE '*#{text}*'}").empty?
|
26
|
+
else
|
27
|
+
warn 'WARN: iOS > 5 detected - cannot test for email body text'
|
19
28
|
end
|
20
29
|
end
|
21
30
|
|
@@ -24,18 +33,18 @@ module Briar
|
|
24
33
|
end
|
25
34
|
|
26
35
|
def email_subject_is? (text)
|
27
|
-
if device.
|
28
|
-
warn 'WARN: iOS6 detected - cannot test for email subject text https://groups.google.com/d/topic/calabash-ios/Ff3XFsjp-B0/discussion'
|
29
|
-
else
|
36
|
+
if device.ios5?
|
30
37
|
email_subject.eql? text
|
38
|
+
else
|
39
|
+
warn 'WARN: iOS > 5 detected - cannot test for email subject text'
|
31
40
|
end
|
32
41
|
end
|
33
42
|
|
34
43
|
def email_subject_has_text_like? (text)
|
35
|
-
if device.
|
36
|
-
warn 'WARN: iOS6 detected - cannot test for email subject text https://groups.google.com/d/topic/calabash-ios/Ff3XFsjp-B0/discussion'
|
37
|
-
else
|
44
|
+
if device.ios5?
|
38
45
|
!query("view:'MFComposeSubjectView' {text LIKE '*#{text}*'}").empty?
|
46
|
+
else
|
47
|
+
warn 'WARN: iOS > 5 detected - cannot test for email subject text'
|
39
48
|
end
|
40
49
|
end
|
41
50
|
|
@@ -44,10 +53,10 @@ module Briar
|
|
44
53
|
end
|
45
54
|
|
46
55
|
def email_to_field_is? (text)
|
47
|
-
if device.
|
48
|
-
warn 'WARN: iOS6 detected - cannot test for email to field https://groups.google.com/d/topic/calabash-ios/Ff3XFsjp-B0/discussion'
|
49
|
-
else
|
56
|
+
if device.ios5?
|
50
57
|
email_to.eql? text
|
58
|
+
else
|
59
|
+
warn 'WARN: iOS > 5 detected - cannot test for email to field'
|
51
60
|
end
|
52
61
|
end
|
53
62
|
|
@@ -72,40 +81,89 @@ module Briar
|
|
72
81
|
end
|
73
82
|
|
74
83
|
def is_ios6_mail_view
|
75
|
-
|
84
|
+
warn 'WARN: deprected 0.0.9'
|
76
85
|
end
|
77
86
|
|
78
|
-
def should_see_mail_view (timeout=
|
79
|
-
if
|
80
|
-
|
87
|
+
def should_see_mail_view (timeout=BRIAR_WAIT_TIMEOUT)
|
88
|
+
if email_not_testable?
|
89
|
+
warn_about_no_ios5_email_view
|
90
|
+
return
|
81
91
|
end
|
82
92
|
|
83
93
|
msg = "waited for '#{timeout}' seconds but did not see email compose view"
|
94
|
+
dev = device()
|
84
95
|
wait_for(:timeout => timeout,
|
85
96
|
:retry_frequency => 0.2,
|
86
97
|
:post_timeout => 0.1,
|
87
|
-
:timeout_message => msg
|
88
|
-
|
98
|
+
:timeout_message => msg) do
|
99
|
+
if dev.ios5?
|
100
|
+
is_ios5_mail_view
|
101
|
+
else
|
102
|
+
view_exists? 'compose email'
|
103
|
+
end
|
89
104
|
end
|
90
105
|
end
|
91
106
|
|
107
|
+
#noinspection RubyResolve
|
92
108
|
def device_can_send_email
|
93
109
|
return true if device.simulator?
|
94
|
-
|
110
|
+
if defined? backdoor_device_configured_for_mail?
|
111
|
+
backdoor_device_configured_for_mail?
|
112
|
+
else
|
113
|
+
pending 'you will need to create a backdoor method to check if the device can send an email'
|
114
|
+
end
|
95
115
|
end
|
96
116
|
|
97
117
|
def delete_draft_and_wait_for (view_id)
|
98
|
-
if
|
99
|
-
|
118
|
+
if email_not_testable?
|
119
|
+
warn_about_no_ios5_email_view
|
120
|
+
return
|
121
|
+
end
|
122
|
+
|
123
|
+
# does a wait for iOS > 5 + uia available
|
124
|
+
should_see_mail_view
|
125
|
+
|
126
|
+
device = device()
|
127
|
+
|
128
|
+
if device.ios5?
|
129
|
+
touch_navbar_item_and_wait_for_view 'Cancel', 'Delete Draft'
|
130
|
+
step_pause
|
131
|
+
touch_sheet_button_and_wait_for_view 'Delete Draft', view_id
|
100
132
|
else
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
133
|
+
sbo = status_bar_orientation.to_sym
|
134
|
+
|
135
|
+
if sbo.eql?(:left) or sbo.eql?(:right)
|
136
|
+
pending "iOS > 5 detected AND orientation '#{sbo}' - there is a bug in UIAutomation that prohibits touching the cancel button"
|
137
|
+
end
|
138
|
+
|
139
|
+
# might also occur on devices, but i don't know
|
140
|
+
if sbo.eql?(:up) and device.ipad? and device.simulator?
|
141
|
+
pending "iOS > 5 detected AND orientation '#{sbo}' AND simulator - there is a bug in UIAutomation prohibits touching the cancel button"
|
142
|
+
end
|
143
|
+
|
144
|
+
timeout = BRIAR_WAIT_TIMEOUT * 2
|
145
|
+
msg = "waited for '#{timeout}' seconds but did not see cancel button"
|
146
|
+
wait_for(:timeout => timeout,
|
147
|
+
:retry_frequency => 1.1,
|
148
|
+
:post_timeout => 0.1,
|
149
|
+
:timeout_message => msg) do
|
150
|
+
uia_element_exists?(:view, marked: 'Cancel')
|
151
|
+
end
|
152
|
+
|
153
|
+
uia_tap_mark('Cancel')
|
154
|
+
msg = "waited for '#{timeout}' seconds but did not see dismiss email action sheet"
|
155
|
+
wait_for(:timeout => timeout,
|
156
|
+
:retry_frequency => 1.1,
|
157
|
+
:post_timeout => 0.1,
|
158
|
+
:timeout_message => msg) do
|
159
|
+
uia_element_exists?(:view, marked: 'Delete Draft')
|
160
|
+
end
|
161
|
+
|
162
|
+
uia_tap_mark('Delete Draft')
|
163
|
+
|
164
|
+
wait_for_view_to_disappear 'compose email'
|
108
165
|
end
|
166
|
+
step_pause
|
109
167
|
end
|
110
168
|
end
|
111
169
|
end
|