File tree 2 files changed +30
-0
lines changed
android_tests/lib/android/specs/common
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,35 @@ def must_return_element element
99
99
long_press_keycode 176
100
100
end
101
101
102
+ t 'open_notifications' do
103
+ # test & comments from https://github.com/appium/appium/blob/master/test/functional/android/apidemos/notifications-specs.js#L19
104
+ # get to the notification page
105
+ wait { scroll_to ( 'App' ) . click }
106
+ wait { scroll_to ( 'Notification' ) . click }
107
+ wait { scroll_to ( 'Status Bar' ) . click }
108
+ # create a notification
109
+ wait { button ( ':-|' ) . click }
110
+ open_notifications
111
+ # shouldn't see the elements behind shade
112
+ wait_true { !exists { find ( ':-|' ) } }
113
+ # should see the notification
114
+ wait_true { text_exact 'Mood ring' }
115
+ # return to app
116
+ back
117
+ # should be able to see elements from app
118
+ wait_true { button ( ':-|' ) }
119
+
120
+ # go back, waiting for each page to load.
121
+ # if we go back using 3.times { back }
122
+ # then android will flake out and discard some back events
123
+ back
124
+ wait { text ( 'Status Bar' ) }
125
+ back
126
+ wait { text ( 'Notification' ) }
127
+ back
128
+ wait { text ( 'App' ) }
129
+ end
130
+
102
131
t 'action_chain' do
103
132
wait do
104
133
e = find_element ( :name , 'Accessibility' )
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ module Device
6
6
7
7
NoArgMethods = {
8
8
post : {
9
+ open_notifications : 'session/:session_id/appium/device/open_notifications' ,
9
10
shake : 'session/:session_id/appium/device/shake' ,
10
11
launch : 'session/:session_id/appium/app/launch' ,
11
12
close_app : 'session/:session_id/appium/app/close' ,
You can’t perform that action at this time.
0 commit comments