@@ -21,88 +21,51 @@ def action_login(device, serialno):
21
21
device .press ('KEYCODE_DPAD_DOWN' )
22
22
time .sleep (1 )
23
23
24
- def action_open_drawer (device , serialno ):
25
- print ("open drawer" )
24
+ def action_open_my_sites (device , serialno ):
25
+ print ("open my sites" )
26
+ device .press ('KEYCODE_TAB' )
26
27
for i in range (5 ):
27
- device .press ('KEYCODE_DPAD_UP' )
28
28
device .press ('KEYCODE_DPAD_LEFT' )
29
- device .press ('KEYCODE_ENTER' )
30
- # Wait for the animation to finish
31
- time .sleep (1 )
32
-
33
- # Menu drawer should be opened when calling this
34
- def action_open_notifications (device , serialno ):
35
- print ("open notifications" )
36
- for i in range (5 ):
37
- device .press ('KEYCODE_DPAD_UP' )
38
- device .press ('KEYCODE_DPAD_DOWN' )
39
- device .press ('KEYCODE_DPAD_DOWN' )
40
- device .press ('KEYCODE_ENTER' )
41
- # lose focus
42
- time .sleep (1 )
43
- device .press ('KEYCODE_DPAD_DOWN' )
44
29
# Wait for gravatars to load
45
- time .sleep (10 )
30
+ time .sleep (2 )
46
31
47
- # Menu drawer should be opened when calling this
48
- def action_open_reader_posts_i_like (device , serialno ):
32
+ def action_open_reader_freshlypressed (device , serialno ):
49
33
print ("open reader" )
50
34
# Open the reader
51
- for i in range (3 ):
52
- device .press ('KEYCODE_DPAD_UP' )
53
- device .press ('KEYCODE_DPAD_DOWN' )
54
- device .press ('KEYCODE_ENTER' )
55
- time .sleep (1 )
56
- # Be sure to focus the hamburger
57
- for i in range (3 ):
58
- device .press ('KEYCODE_DPAD_UP' )
35
+ for i in range (5 ):
59
36
device .press ('KEYCODE_DPAD_LEFT' )
60
- # Select dropdown
61
37
device .press ('KEYCODE_DPAD_RIGHT' )
62
- device .press ('KEYCODE_ENTER' )
63
- for i in range (3 ):
64
- device .press ('KEYCODE_DPAD_UP' )
65
- # Select Post I Like
66
- device .press ('KEYCODE_DPAD_DOWN' )
67
- device .press ('KEYCODE_DPAD_DOWN' )
68
- device .press ('KEYCODE_ENTER' )
69
- device .press ('KEYCODE_SEARCH' )
70
38
# Wait for the reader to load articles / pictures
71
- time .sleep (10 )
72
- lose_focus (serialno )
39
+ time .sleep (5 )
73
40
74
- # Menu drawer should be opened when calling this
75
- def action_open_media (device , serialno ):
76
- print ("open media" )
41
+ def action_open_notifications (device , serialno ):
42
+ print ("open notifications tab" )
77
43
# Open the reader
44
+ for i in range (5 ):
45
+ device .press ('KEYCODE_DPAD_LEFT' )
46
+ for i in range (4 ):
47
+ device .press ('KEYCODE_DPAD_RIGHT' )
48
+ time .sleep (5 )
49
+
50
+ def action_open_me (device , serialno ):
51
+ print ("open me tab" )
52
+ # Open the reader
53
+ for i in range (5 ):
54
+ device .press ('KEYCODE_DPAD_LEFT' )
78
55
for i in range (3 ):
79
- device .press ('KEYCODE_DPAD_UP' )
80
- device .press ('KEYCODE_DPAD_DOWN' )
81
- device .press ('KEYCODE_DPAD_DOWN' )
82
- device .press ('KEYCODE_DPAD_DOWN' )
83
- device .press ('KEYCODE_DPAD_DOWN' )
84
- device .press ('KEYCODE_ENTER' )
85
- # Wait for the reader to load articles / pictures
86
- time .sleep (10 )
56
+ device .press ('KEYCODE_DPAD_RIGHT' )
57
+ time .sleep (5 )
87
58
88
- # Menu drawer should be opened when calling this
89
59
def action_open_editor_and_type_text (device , serialno ):
90
60
print ("open editor" )
91
- # Open Posts
92
- for i in range (3 ):
93
- device .press ('KEYCODE_DPAD_UP' )
94
- device .press ('KEYCODE_DPAD_DOWN' )
95
- device .press ('KEYCODE_DPAD_DOWN' )
61
+ # Open My Sites
62
+ for i in range (5 ):
63
+ device .press ('KEYCODE_DPAD_LEFT' )
64
+ # Select FAB and open the editor
96
65
device .press ('KEYCODE_DPAD_DOWN' )
97
66
device .press ('KEYCODE_ENTER' )
98
67
time .sleep (1 )
99
- # Open editor
100
- device .press ('KEYCODE_DPAD_RIGHT' )
101
- device .press ('KEYCODE_ENTER' )
102
- time .sleep (1 )
103
- device .press ('KEYCODE_TAB' )
104
- device .press ('KEYCODE_DPAD_DOWN' )
105
- # Type a sample text (spaces can't be entered via device.type())
68
+ # Type a sample text (spaces can't be entered via device.type())
106
69
for word in settings .example_post_content .split ():
107
70
device .type (word )
108
71
device .press ('KEYCODE_SPACE' )
@@ -154,28 +117,34 @@ def back(device):
154
117
# Main scenario + screenshots
155
118
156
119
def run_tests_for_device_and_lang (device , serialno , filename , lang , packagename , apk ):
120
+ # Install the apk`
157
121
reinstall_apk (serialno , packagename , apk )
122
+
123
+ # Change language setting
158
124
change_lang_settings (serialno , lang )
125
+
126
+ # Launch the app
159
127
launch_activity (device , packagename , "org.wordpress.android.ui.WPLaunchActivity" )
160
128
take_screenshot (serialno , lang + "-login-screen-" + filename )
129
+
130
+ # Login into the app
161
131
action_login (device , serialno )
162
- take_screenshot (serialno , lang + "-post-login-" + filename )
163
- action_open_drawer (device , serialno )
164
- take_screenshot (serialno , lang + "-drawer-opened-" + filename )
132
+
133
+ # Action!
134
+ action_open_my_sites (device , serialno )
135
+ take_screenshot (serialno , lang + "-1-my-sites-" + filename )
136
+ action_open_reader_freshlypressed (device , serialno )
137
+ take_screenshot (serialno , lang + "-2-reader-freshlypressed-" + filename )
138
+ action_open_me (device , serialno )
139
+ take_screenshot (serialno , lang + "-3-me-tab-" + filename )
165
140
action_open_notifications (device , serialno )
166
- take_screenshot (serialno , lang + "-notifications-" + filename )
167
- action_open_drawer (device , serialno )
168
- action_open_reader_posts_i_like (device , serialno )
169
- take_screenshot (serialno , lang + "-reader-" + filename )
170
- action_open_drawer (device , serialno )
171
- action_open_media (device , serialno )
172
- take_screenshot (serialno , lang + "-media-" + filename )
173
- action_open_drawer (device , serialno )
174
- action_open_editor_and_type_text (device , serialno )
175
- take_screenshot (serialno , lang + "-editor-" + filename )
141
+ take_screenshot (serialno , lang + "-4-notifications-" + filename )
142
+
143
+ #action_open_editor_and_type_text(device, serialno)
144
+ #take_screenshot(serialno, lang + "-editor-" + filename)
176
145
# Close virtual keyboard and editor
177
- back (device )
178
- back (device )
146
+ # back(device)
147
+ # back(device)
179
148
180
149
def list_devices ():
181
150
devices = []
0 commit comments