Merge lp:~elopio/selenium-simple-test/flake8-1 into lp:selenium-simple-test

Proposed by Leo Arias
Status: Merged
Approved by: Corey Goldberg
Approved revision: 384
Merged at revision: 384
Proposed branch: lp:~elopio/selenium-simple-test/flake8-1
Merge into: lp:selenium-simple-test
Diff against target: 1020 lines (+357/-343)
22 files modified
src/sst/selftests/no_js.py (+8/-8)
src/sst/selftests/prefs_set_trusted.py (+6/-6)
src/sst/selftests/radio.py (+38/-36)
src/sst/selftests/refresh.py (+12/-11)
src/sst/selftests/run_test.py (+6/-5)
src/sst/selftests/select.py (+19/-16)
src/sst/selftests/shared/helpers.py (+3/-3)
src/sst/selftests/source.py (+5/-5)
src/sst/selftests/static_file.py (+8/-8)
src/sst/selftests/subdirectory/run_test.py (+9/-9)
src/sst/selftests/switch_to_frame.py (+22/-22)
src/sst/selftests/switch_to_window.py (+31/-31)
src/sst/selftests/tables.py (+47/-40)
src/sst/selftests/text.py (+10/-10)
src/sst/selftests/textfield.py (+24/-24)
src/sst/selftests/title.py (+29/-29)
src/sst/selftests/unicode.py (+12/-12)
src/sst/selftests/wait_timeout.py (+8/-8)
src/sst/selftests/waitfor.py (+28/-28)
src/sst/selftests/window_close.py (+10/-10)
src/sst/selftests/window_size.py (+17/-17)
src/sst/selftests/yui.py (+5/-5)
To merge this branch: bzr merge lp:~elopio/selenium-simple-test/flake8-1
Reviewer Review Type Date Requested Status
Corey Goldberg (community) Approve
Review via email: mp+159769@code.launchpad.net

Commit message

Fixed the import in some acceptance tests.

Description of the change

2 more cents for the pep8 cause.

To post a comment you must log in.
Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

lgtm

review: Approve
Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

landing this now. I have a followup branch with more (all) imports fixed in acceptance tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sst/selftests/no_js.py'
2--- src/sst/selftests/no_js.py 2013-04-16 15:25:57 +0000
3+++ src/sst/selftests/no_js.py 2013-04-19 08:09:29 +0000
4@@ -1,15 +1,15 @@
5-from sst.actions import *
6+import sst.actions
7 from sst import config
8
9 # disabling javascript is currently only implemented for Firefox in sst
10 if config.browser_type != 'firefox':
11- skip()
12-
13-JAVASCRIPT_DISABLED = True
14-
15-go_to('/nojs/')
16-
17-assert_text('test', "Before JS")
18+ sst.actions.skip()
19+
20+sst.actions.JAVASCRIPT_DISABLED = True
21+
22+sst.actions.go_to('/nojs/')
23+
24+sst.actions.assert_text('test', "Before JS")
25
26 from sst import config
27 assert config.javascript_disabled
28
29=== modified file 'src/sst/selftests/prefs_set_trusted.py'
30--- src/sst/selftests/prefs_set_trusted.py 2013-03-11 14:52:46 +0000
31+++ src/sst/selftests/prefs_set_trusted.py 2013-04-19 08:09:29 +0000
32@@ -1,6 +1,6 @@
33-from sst.actions import *
34-
35-
36-ASSUME_TRUSTED_CERT_ISSUER = True
37-
38-assert ASSUME_TRUSTED_CERT_ISSUER
39+import sst.actions
40+
41+
42+sst.actions.ASSUME_TRUSTED_CERT_ISSUER = True
43+
44+assert sst.actions.ASSUME_TRUSTED_CERT_ISSUER
45
46=== modified file 'src/sst/selftests/radio.py'
47--- src/sst/selftests/radio.py 2011-12-07 19:35:25 +0000
48+++ src/sst/selftests/radio.py 2013-04-19 08:09:29 +0000
49@@ -1,36 +1,38 @@
50-from sst.actions import *
51-
52-go_to('/')
53-
54-assert_radio('radio_with_id_1')
55-assert_radio(get_element(id='radio_with_id_1'))
56-fails(assert_radio, 'does not exist')
57-fails(assert_radio, 'headline')
58-
59-assert_radio_value('radio_with_id_1', True)
60-assert_radio_value(get_element(id='radio_with_id_1'), True)
61-fails(assert_radio_value, 'radio_with_id_1', False)
62-fails(assert_radio_value, 'headline', True)
63-
64-assert_radio_value('radio_with_id_2', False)
65-fails(assert_radio_value, 'radio_with_id_2', True)
66-
67-set_radio_value('radio_with_id_1')
68-assert_radio_value('radio_with_id_1', True)
69-assert_radio_value('radio_with_id_2', False)
70-
71-set_radio_value('radio_with_id_2')
72-assert_radio_value('radio_with_id_1', False)
73-assert_radio_value('radio_with_id_2', True)
74-
75-set_radio_value(get_element(id='radio_with_id_1'))
76-assert_radio_value('radio_with_id_1', True)
77-assert_radio_value('radio_with_id_2', False)
78-
79-fails(set_radio_value, 'does not exist')
80-fails(set_radio_value, 'headline')
81-
82-assert_text('label1', 'First')
83-fails(assert_text, 'label1', 'the wrong text')
84-fails(assert_text, 'does not exist', 'does not matter')
85-fails(assert_text, 'radio_with_id_1', 'has no text')
86+import sst.actions
87+
88+
89+sst.actions.go_to('/')
90+
91+sst.actions.assert_radio('radio_with_id_1')
92+sst.actions.assert_radio(sst.actions.get_element(id='radio_with_id_1'))
93+sst.actions.fails(sst.actions.assert_radio, 'does not exist')
94+sst.actions.fails(sst.actions.assert_radio, 'headline')
95+
96+sst.actions.assert_radio_value('radio_with_id_1', True)
97+sst.actions.assert_radio_value(
98+ sst.actions.get_element(id='radio_with_id_1'), True)
99+sst.actions.fails(sst.actions.assert_radio_value, 'radio_with_id_1', False)
100+sst.actions.fails(sst.actions.assert_radio_value, 'headline', True)
101+
102+sst.actions.assert_radio_value('radio_with_id_2', False)
103+sst.actions.fails(sst.actions.assert_radio_value, 'radio_with_id_2', True)
104+
105+sst.actions.set_radio_value('radio_with_id_1')
106+sst.actions.assert_radio_value('radio_with_id_1', True)
107+sst.actions.assert_radio_value('radio_with_id_2', False)
108+
109+sst.actions.set_radio_value('radio_with_id_2')
110+sst.actions.assert_radio_value('radio_with_id_1', False)
111+sst.actions.assert_radio_value('radio_with_id_2', True)
112+
113+sst.actions.set_radio_value(sst.actions.get_element(id='radio_with_id_1'))
114+sst.actions.assert_radio_value('radio_with_id_1', True)
115+sst.actions.assert_radio_value('radio_with_id_2', False)
116+
117+sst.actions.fails(sst.actions.set_radio_value, 'does not exist')
118+sst.actions.fails(sst.actions.set_radio_value, 'headline')
119+
120+sst.actions.assert_text('label1', 'First')
121+sst.actions.fails(sst.actions.assert_text, 'label1', 'the wrong text')
122+sst.actions.fails(sst.actions.assert_text, 'does not exist', 'does not matter')
123+sst.actions.fails(sst.actions.assert_text, 'radio_with_id_1', 'has no text')
124
125=== modified file 'src/sst/selftests/refresh.py'
126--- src/sst/selftests/refresh.py 2012-03-30 12:07:06 +0000
127+++ src/sst/selftests/refresh.py 2013-04-19 08:09:29 +0000
128@@ -1,11 +1,12 @@
129-from sst.actions import *
130-
131-go_to('/')
132-
133-assert_title('The Page Title')
134-assert_url('/')
135-
136-refresh()
137-
138-assert_title('The Page Title')
139-assert_url('/')
140+import sst.actions
141+
142+
143+sst.actions.go_to('/')
144+
145+sst.actions.assert_title('The Page Title')
146+sst.actions.assert_url('/')
147+
148+sst.actions.refresh()
149+
150+sst.actions.assert_title('The Page Title')
151+sst.actions.assert_url('/')
152
153=== modified file 'src/sst/selftests/run_test.py'
154--- src/sst/selftests/run_test.py 2012-12-16 15:25:23 +0000
155+++ src/sst/selftests/run_test.py 2013-04-19 08:09:29 +0000
156@@ -1,11 +1,12 @@
157 from sst import actions
158-from sst.actions import *
159+import sst.actions
160+
161
162 foo = 3
163-set_wait_timeout(1, 0.2)
164-set_base_url('http://foo/')
165+sst.actions.set_wait_timeout(1, 0.2)
166+sst.actions.set_base_url('http://foo/')
167
168-args = run_test('_test')
169+args = sst.actions.run_test('_test')
170 assert args == {
171 'one': 'foo',
172 'two': 2
173@@ -17,7 +18,7 @@
174 assert actions._POLL == 0.2
175 assert actions.BASE_URL == 'http://foo/'
176
177-args = run_test('_test', one='ONE', two=3.1)
178+args = sst.actions.run_test('_test', one='ONE', two=3.1)
179 assert args == {
180 'one': 'ONE',
181 'two': 3.1
182
183=== modified file 'src/sst/selftests/select.py'
184--- src/sst/selftests/select.py 2012-12-16 15:25:23 +0000
185+++ src/sst/selftests/select.py 2013-04-19 08:09:29 +0000
186@@ -1,21 +1,24 @@
187-from sst.actions import *
188-
189-go_to('/')
190-
191-assert_dropdown('select_with_id_1')
192-
193-assert_dropdown(get_element(id='select_with_id_1'))
194-
195-fails(assert_dropdown, 'fake_id')
196-
197-fails(assert_dropdown, 'headline')
198-
199-set_dropdown_value('select_with_id_1', 'Select Two')
200-assert_dropdown_value('select_with_id_1', 'Select Two')
201+import sst.actions
202+
203+
204+sst.actions.go_to('/')
205+
206+sst.actions.assert_dropdown('select_with_id_1')
207+
208+sst.actions.assert_dropdown(sst.actions.get_element(id='select_with_id_1'))
209+
210+sst.actions.fails(sst.actions.assert_dropdown, 'fake_id')
211+
212+sst.actions.fails(sst.actions.assert_dropdown, 'headline')
213+
214+sst.actions.set_dropdown_value('select_with_id_1', 'Select Two')
215+sst.actions.assert_dropdown_value('select_with_id_1', 'Select Two')
216
217 # the following should fail saying that the option
218 # is not set to the expected value
219-fails(assert_dropdown_value, 'select_with_id_1', 'Fake Text')
220+sst.actions.fails(
221+ sst.actions.assert_dropdown_value, 'select_with_id_1', 'Fake Text')
222
223 # The following should fail saying that the option does not exist
224-fails(set_dropdown_value, 'select_with_id_1', 'Fake Text')
225+sst.actions.fails(
226+ sst.actions.set_dropdown_value, 'select_with_id_1', 'Fake Text')
227
228=== modified file 'src/sst/selftests/shared/helpers.py'
229--- src/sst/selftests/shared/helpers.py 2013-04-18 18:37:10 +0000
230+++ src/sst/selftests/shared/helpers.py 2013-04-19 08:09:29 +0000
231@@ -1,7 +1,7 @@
232 import os
233 import shutil
234
235-from sst.actions import *
236+import sst.actions
237
238
239 def skip_as_jenkins():
240@@ -11,7 +11,7 @@
241 except KeyError:
242 user = 'notjenkins'
243 if user.lower() == 'jenkins':
244- skip()
245+ sst.actions.skip()
246
247
248 def setup_cleanup_test_db():
249@@ -23,4 +23,4 @@
250 if os.path.isfile(test_db):
251 os.remove(test_db)
252 shutil.copyfile(test_db + '.original', test_db)
253- add_cleanup(os.remove, test_db)
254+ sst.actions.add_cleanup(os.remove, test_db)
255
256=== modified file 'src/sst/selftests/source.py'
257--- src/sst/selftests/source.py 2012-08-24 13:24:44 +0000
258+++ src/sst/selftests/source.py 2013-04-19 08:09:29 +0000
259@@ -1,11 +1,11 @@
260-from sst.actions import *
261+import sst.actions
262
263
264 # test get_page_source
265
266-go_to('/')
267+sst.actions.go_to('/')
268
269-txt = get_page_source()
270+txt = sst.actions.get_page_source()
271
272 assert (txt != '')
273 assert '<html' in txt
274@@ -15,7 +15,7 @@
275
276 # test get_element_source
277
278-elems = get_elements(tag='p')
279+elems = sst.actions.get_elements(tag='p')
280 for elem in elems:
281- txt = get_element_source(elem)
282+ txt = sst.actions.get_element_source(elem)
283 assert (len(txt) >= 0)
284
285=== modified file 'src/sst/selftests/static_file.py'
286--- src/sst/selftests/static_file.py 2012-12-16 15:25:23 +0000
287+++ src/sst/selftests/static_file.py 2013-04-19 08:09:29 +0000
288@@ -3,19 +3,19 @@
289
290 import os
291
292-from sst.actions import *
293+import sst.actions
294
295
296 static_file = os.path.join(''.join(os.path.split(__file__)[:-1]),
297 'static.html')
298
299 # using full path
300-go_to('file:////%s' % static_file)
301-assert_title('The Static Page')
302-assert_element(tag='h1', text='Hello World')
303+sst.actions.go_to('file:////%s' % static_file)
304+sst.actions.assert_title('The Static Page')
305+sst.actions.assert_element(tag='h1', text='Hello World')
306
307 # using base_url
308-set_base_url('file:////')
309-go_to(static_file)
310-assert_title('The Static Page')
311-assert_element(tag='h1', text='Hello World')
312+sst.actions.set_base_url('file:////')
313+sst.actions.go_to(static_file)
314+sst.actions.assert_title('The Static Page')
315+sst.actions.assert_element(tag='h1', text='Hello World')
316
317=== modified file 'src/sst/selftests/subdirectory/run_test.py'
318--- src/sst/selftests/subdirectory/run_test.py 2012-12-16 15:25:23 +0000
319+++ src/sst/selftests/subdirectory/run_test.py 2013-04-19 08:09:29 +0000
320@@ -1,11 +1,11 @@
321-from sst import actions
322-from sst.actions import *
323+import sst.actions
324+
325
326 foo = 3
327-set_wait_timeout(1, 0.2)
328-set_base_url('http://foo/')
329+sst.actions.set_wait_timeout(1, 0.2)
330+sst.actions.set_base_url('http://foo/')
331
332-args = run_test('../_test')
333+args = sst.actions.run_test('../_test')
334 assert args == {
335 'one': 'foo',
336 'two': 2
337@@ -13,11 +13,11 @@
338
339 # check the context hasn't been altered
340 assert foo == 3
341-assert actions._TIMEOUT == 1
342-assert actions._POLL == 0.2
343-assert actions.BASE_URL == 'http://foo/'
344+assert sst.actions._TIMEOUT == 1
345+assert sst.actions._POLL == 0.2
346+assert sst.actions.BASE_URL == 'http://foo/'
347
348-args = run_test('../_test', one='ONE', two=3.1)
349+args = sst.actions.run_test('../_test', one='ONE', two=3.1)
350 assert args == {
351 'one': 'ONE',
352 'two': 3.1
353
354=== modified file 'src/sst/selftests/switch_to_frame.py'
355--- src/sst/selftests/switch_to_frame.py 2013-04-16 15:25:57 +0000
356+++ src/sst/selftests/switch_to_frame.py 2013-04-19 08:09:29 +0000
357@@ -1,43 +1,43 @@
358-from sst.actions import *
359+import sst.actions
360 from sst import config
361
362 # PhantomJS can not do multiple windows by design
363 if config.browser_type == 'phantomjs':
364- skip()
365+ sst.actions.skip()
366
367-go_to('/')
368-click_link('popup_link')
369+sst.actions.go_to('/')
370+sst.actions.click_link('popup_link')
371
372 # switch to new window/tab
373-switch_to_window('_NEW_WINDOW')
374-assert_title('Popup Window')
375+sst.actions.switch_to_window('_NEW_WINDOW')
376+sst.actions.assert_title('Popup Window')
377
378 # fails when frame index is out of range
379-fails(switch_to_frame, index_or_name=2)
380+sst.actions.fails(sst.actions.switch_to_frame, index_or_name=2)
381
382 # switch to a valid frame index
383-switch_to_frame(index_or_name=1)
384-elem = get_element(id='frame_b_id')
385-assert_text(elem, 'Frame B text here')
386+sst.actions.switch_to_frame(index_or_name=1)
387+elem = sst.actions.get_element(id='frame_b_id')
388+sst.actions.assert_text(elem, 'Frame B text here')
389
390 # fails because we are in sibling frame
391-fails(get_element, id='frame_a_id')
392+sst.actions.fails(sst.actions.get_element, id='frame_a_id')
393
394 # switch back to default frame
395-switch_to_frame()
396-get_element(tag='p', id='popup_id', text='Popup text here')
397-assert_title('Popup Window')
398+sst.actions.switch_to_frame()
399+sst.actions.get_element(tag='p', id='popup_id', text='Popup text here')
400+sst.actions.assert_title('Popup Window')
401
402 # switch to a valid frame name
403-switch_to_frame(index_or_name='frame_a')
404-elem = get_element(id='frame_a_id')
405-assert_text(elem, 'Frame A text here')
406+sst.actions.switch_to_frame(index_or_name='frame_a')
407+elem = sst.actions.get_element(id='frame_a_id')
408+sst.actions.assert_text(elem, 'Frame A text here')
409
410 # switch back to default frame
411-switch_to_frame()
412-get_element(tag='p', id='popup_id', text='Popup text here')
413-assert_title('Popup Window')
414+sst.actions.switch_to_frame()
415+sst.actions.get_element(tag='p', id='popup_id', text='Popup text here')
416+sst.actions.assert_title('Popup Window')
417
418 # switch back to default/main window/tab
419-switch_to_window()
420-assert_title('The Page Title')
421+sst.actions.switch_to_window()
422+sst.actions.assert_title('The Page Title')
423
424=== modified file 'src/sst/selftests/switch_to_window.py'
425--- src/sst/selftests/switch_to_window.py 2013-04-16 15:25:57 +0000
426+++ src/sst/selftests/switch_to_window.py 2013-04-19 08:09:29 +0000
427@@ -1,52 +1,52 @@
428-from sst.actions import *
429+import sst.actions
430 from sst import config
431
432 # PhantomJS can not do multiple windows by design
433 if config.browser_type == 'phantomjs':
434- skip()
435+ sst.actions.skip()
436
437-go_to('/')
438-click_link('popup_link')
439+sst.actions.go_to('/')
440+sst.actions.click_link('popup_link')
441
442 # switch to new window/tab
443-switch_to_window(index_or_name='_NEW_WINDOW')
444-assert_title('Popup Window')
445+sst.actions.switch_to_window(index_or_name='_NEW_WINDOW')
446+sst.actions.assert_title('Popup Window')
447
448 # switch back to default/main window/tab
449-switch_to_window()
450-assert_title('The Page Title')
451+sst.actions.switch_to_window()
452+sst.actions.assert_title('The Page Title')
453
454 # switch to new window/tab
455-switch_to_window('_NEW_WINDOW')
456-assert_title('Popup Window')
457+sst.actions.switch_to_window('_NEW_WINDOW')
458+sst.actions.assert_title('Popup Window')
459
460 # verify we can access content in new window
461-elem = get_element(tag='p', id='popup_id', text='Popup text here')
462-assert_text(elem, 'Popup text here')
463+elem = sst.actions.get_element(tag='p', id='popup_id', text='Popup text here')
464+sst.actions.assert_text(elem, 'Popup text here')
465
466 # switch back to default/main window/tab
467-switch_to_window(index_or_name='')
468-assert_title('The Page Title')
469+sst.actions.switch_to_window(index_or_name='')
470+sst.actions.assert_title('The Page Title')
471
472 # switch to new window/tab using index
473-switch_to_window(index_or_name=1)
474-assert_title('Popup Window')
475+sst.actions.switch_to_window(index_or_name=1)
476+sst.actions.assert_title('Popup Window')
477
478 # switch back to default/main window using index
479-switch_to_window(0)
480-assert_title('The Page Title')
481-
482-# fails when the window name does not exist
483-fails(switch_to_window, index_or_name='not_a_window')
484-
485-# fails when the window name does not exist
486-fails(switch_to_window, 'not_a_window')
487-
488-# fails when the window index does not exist
489-fails(switch_to_window, index_or_name=99)
490-
491-# fails when the window index does not exist
492-fails(switch_to_window, 99)
493+sst.actions.switch_to_window(0)
494+sst.actions.assert_title('The Page Title')
495+
496+# fails when the window name does not exist
497+sst.actions.fails(sst.actions.switch_to_window, index_or_name='not_a_window')
498+
499+# fails when the window name does not exist
500+sst.actions.fails(sst.actions.switch_to_window, 'not_a_window')
501+
502+# fails when the window index does not exist
503+sst.actions.fails(sst.actions.switch_to_window, index_or_name=99)
504+
505+# fails when the window index does not exist
506+sst.actions.fails(sst.actions.switch_to_window, 99)
507
508 # verify we are still back on main window
509-assert_title('The Page Title')
510+sst.actions.assert_title('The Page Title')
511
512=== modified file 'src/sst/selftests/tables.py'
513--- src/sst/selftests/tables.py 2012-12-16 15:25:23 +0000
514+++ src/sst/selftests/tables.py 2013-04-19 08:09:29 +0000
515@@ -1,42 +1,49 @@
516-from sst.actions import *
517-
518-go_to('/tables')
519-
520-assert_table_headers('empty', ['Head 0', 'Head 1', 'Head 2', 'Head 3'])
521-assert_table_has_rows('empty', 0)
522-assert_table_has_rows('one-row', 1)
523-
524-fails(assert_table_headers, 'notthere',
525- ['Head 0', 'Head 1', 'Head 2', 'Head 3'])
526-fails(assert_table_headers, 'empty', ['Head 0', 'Head 1', 'Head 2'])
527-fails(assert_table_headers, 'empty',
528- ['Wrong', 'Head 1', 'Head 2', 'Head 3'])
529-fails(assert_table_has_rows, 'notthere', 0)
530-fails(assert_table_has_rows, 'empty', 1)
531+import sst.actions
532+
533+sst.actions.go_to('/tables')
534+
535+sst.actions.assert_table_headers(
536+ 'empty', ['Head 0', 'Head 1', 'Head 2', 'Head 3'])
537+sst.actions.assert_table_has_rows('empty', 0)
538+sst.actions.assert_table_has_rows('one-row', 1)
539+
540+sst.actions.fails(
541+ sst.actions.assert_table_headers, 'notthere',
542+ ['Head 0', 'Head 1', 'Head 2', 'Head 3'])
543+sst.actions.fails(
544+ sst.actions.assert_table_headers, 'empty', ['Head 0', 'Head 1', 'Head 2'])
545+sst.actions.fails(
546+ sst.actions.assert_table_headers, 'empty',
547+ ['Wrong', 'Head 1', 'Head 2', 'Head 3'])
548+sst.actions.fails(sst.actions.assert_table_has_rows, 'notthere', 0)
549+sst.actions.fails(sst.actions.assert_table_has_rows, 'empty', 1)
550
551 # XXXX Should this be able to work?
552-fails(assert_table_has_rows, 'no-body', 0)
553-
554-fails(assert_table_has_rows, 'one-row', 0)
555-fails(assert_table_has_rows, 'one-row', 2)
556-
557-assert_table_row_contains_text('one-row', 0,
558- ['Cell 0', 'Cell 1', 'Cell 2', 'Cell 3'])
559-assert_table_row_contains_text('one-row', 0,
560- ['Cell 0', 'Cell 1', 'Cell 2', 'Cell 3'],
561- regex=True)
562-assert_table_row_contains_text('one-row', 0,
563- ['^Cell', '^Cell', '^Cell', '^Cell'],
564- regex=True)
565-
566-fails(assert_table_row_contains_text, 'one-row', 0,
567- ['Wrong', 'Cell 1', 'Cell 2', 'Cell 3'])
568-fails(assert_table_row_contains_text, 'one-row', 0,
569- ['Cell 0', 'Cell 1', 'Cell 2'])
570-fails(assert_table_row_contains_text, 'one-row', 0,
571- ['Cell 0', 'Cell 1', 'Cell 2', 'Extra'])
572-fails(assert_table_row_contains_text, 'one-row', 1, [])
573-fails(assert_table_row_contains_text, 'one-row', 0,
574- ['Wrong', 'Cell 1', 'Cell 2', 'Cell 3'], regex=True)
575-fails(assert_table_row_contains_text, 'one-row', 0,
576- ['Cell 0', 'Cell 1', 'Cell 2'], regex=True)
577+sst.actions.fails(sst.actions.assert_table_has_rows, 'no-body', 0)
578+
579+sst.actions.fails(sst.actions.assert_table_has_rows, 'one-row', 0)
580+sst.actions.fails(sst.actions.assert_table_has_rows, 'one-row', 2)
581+
582+sst.actions.assert_table_row_contains_text(
583+ 'one-row', 0, ['Cell 0', 'Cell 1', 'Cell 2', 'Cell 3'])
584+sst.actions.assert_table_row_contains_text(
585+ 'one-row', 0, ['Cell 0', 'Cell 1', 'Cell 2', 'Cell 3'], regex=True)
586+sst.actions.assert_table_row_contains_text(
587+ 'one-row', 0, ['^Cell', '^Cell', '^Cell', '^Cell'], regex=True)
588+
589+sst.actions.fails(
590+ sst.actions.assert_table_row_contains_text, 'one-row', 0,
591+ ['Wrong', 'Cell 1', 'Cell 2', 'Cell 3'])
592+sst.actions.fails(
593+ sst.actions.assert_table_row_contains_text, 'one-row', 0,
594+ ['Cell 0', 'Cell 1', 'Cell 2'])
595+sst.actions.fails(
596+ sst.actions.assert_table_row_contains_text, 'one-row', 0,
597+ ['Cell 0', 'Cell 1', 'Cell 2', 'Extra'])
598+sst.actions.fails(sst.actions.assert_table_row_contains_text, 'one-row', 1, [])
599+sst.actions.fails(
600+ sst.actions.assert_table_row_contains_text, 'one-row', 0,
601+ ['Wrong', 'Cell 1', 'Cell 2', 'Cell 3'], regex=True)
602+sst.actions.fails(
603+ sst.actions.assert_table_row_contains_text, 'one-row', 0,
604+ ['Cell 0', 'Cell 1', 'Cell 2'], regex=True)
605
606=== modified file 'src/sst/selftests/text.py'
607--- src/sst/selftests/text.py 2011-12-07 19:35:25 +0000
608+++ src/sst/selftests/text.py 2013-04-19 08:09:29 +0000
609@@ -1,13 +1,13 @@
610-from sst.actions import *
611+import sst.actions
612
613 # tests for assert_text, text_contains
614
615-go_to('/')
616-
617-title = get_element(tag='title')
618-assert_text(title, 'The Page Title')
619-assert_text_contains(title, 'The Page')
620-fails(assert_text_contains, title, 'foobar')
621-
622-body = get_element(tag='body')
623-assert_text_contains(body, '.*[C|c]ountry.*', regex=True)
624+sst.actions.go_to('/')
625+
626+title = sst.actions.get_element(tag='title')
627+sst.actions.assert_text(title, 'The Page Title')
628+sst.actions.assert_text_contains(title, 'The Page')
629+sst.actions.fails(sst.actions.assert_text_contains, title, 'foobar')
630+
631+body = sst.actions.get_element(tag='body')
632+sst.actions.assert_text_contains(body, '.*[C|c]ountry.*', regex=True)
633
634=== modified file 'src/sst/selftests/textfield.py'
635--- src/sst/selftests/textfield.py 2012-12-16 15:25:23 +0000
636+++ src/sst/selftests/textfield.py 2013-04-19 08:09:29 +0000
637@@ -1,37 +1,37 @@
638-from sst.actions import *
639+import sst.actions
640
641
642 # password functionality is so close to textfield that
643 # we will include it with common textfield use
644
645
646-go_to('/')
647-
648-assert_textfield('text_1')
649-assert_textfield(get_element(id='text_1'))
650-
651-assert_textfield('pass_1')
652-assert_textfield(get_element(id='pass_1'))
653+sst.actions.go_to('/')
654+
655+sst.actions.assert_textfield('text_1')
656+sst.actions.assert_textfield(sst.actions.get_element(id='text_1'))
657+
658+sst.actions.assert_textfield('pass_1')
659+sst.actions.assert_textfield(sst.actions.get_element(id='pass_1'))
660
661 # fails for non existent element
662-fails(assert_textfield, 'foobar')
663+sst.actions.fails(sst.actions.assert_textfield, 'foobar')
664 # fails for element that exists but isn't a textfield
665-fails(assert_textfield, 'radio_with_id_1')
666-
667-write_textfield('text_1', 'I pity the Foobar..')
668-assert_text('text_1', "I pity the Foobar..")
669-
670-write_textfield('text_1', 'Overwriting')
671-assert_text('text_1', "Overwriting")
672-
673-write_textfield('text_1', 'No checking', check=False)
674-assert_text('text_1', 'No checking')
675+sst.actions.fails(sst.actions.assert_textfield, 'radio_with_id_1')
676+
677+sst.actions.write_textfield('text_1', 'I pity the Foobar..')
678+sst.actions.assert_text('text_1', "I pity the Foobar..")
679+
680+sst.actions.write_textfield('text_1', 'Overwriting')
681+sst.actions.assert_text('text_1', "Overwriting")
682+
683+sst.actions.write_textfield('text_1', 'No checking', check=False)
684+sst.actions.assert_text('text_1', 'No checking')
685
686 # check with empty text
687-write_textfield('text_1', '')
688-assert_text('text_1', '')
689+sst.actions.write_textfield('text_1', '')
690+sst.actions.assert_text('text_1', '')
691
692 # checks the password field to see if it is editable
693-write_textfield('pass_1', 'qaT3st')
694-assert_text('pass_1', 'qaT3st')
695-fails(assert_text, 'pass_1', 'fake_text')
696+sst.actions.write_textfield('pass_1', 'qaT3st')
697+sst.actions.assert_text('pass_1', 'qaT3st')
698+sst.actions.fails(sst.actions.assert_text, 'pass_1', 'fake_text')
699
700=== modified file 'src/sst/selftests/title.py'
701--- src/sst/selftests/title.py 2013-04-11 14:18:49 +0000
702+++ src/sst/selftests/title.py 2013-04-19 08:09:29 +0000
703@@ -1,39 +1,39 @@
704-from sst.actions import *
705+import sst.actions
706 from sst import DEVSERVER_PORT
707
708 # tests go_to, assert_url, assert_title, set_base_url
709 # reset_base_url, get_base_url
710
711-go_to('/')
712-
713-assert_url('/')
714-fails(assert_url, '/foo')
715-
716-assert_title('The Page Title')
717-fails(assert_title, 'this is not the title')
718-
719-assert_title_contains('The Page')
720-assert_title_contains('.*Pag[E|e]', regex=True)
721-fails(assert_title_contains, 'foobar')
722-
723-set_base_url('localhost:%s' % DEVSERVER_PORT)
724-assert get_base_url() == 'http://localhost:%s' % DEVSERVER_PORT
725-
726-set_base_url('http://localhost:%s/' % DEVSERVER_PORT)
727-assert get_base_url() == 'http://localhost:%s/' % DEVSERVER_PORT
728-go_to('/')
729+sst.actions.go_to('/')
730+
731+sst.actions.assert_url('/')
732+sst.actions.fails(sst.actions.assert_url, '/foo')
733+
734+sst.actions.assert_title('The Page Title')
735+sst.actions.fails(sst.actions.assert_title, 'this is not the title')
736+
737+sst.actions.assert_title_contains('The Page')
738+sst.actions.assert_title_contains('.*Pag[E|e]', regex=True)
739+sst.actions.fails(sst.actions.assert_title_contains, 'foobar')
740+
741+sst.actions.set_base_url('localhost:%s' % DEVSERVER_PORT)
742+assert sst.actions.get_base_url() == 'http://localhost:%s' % DEVSERVER_PORT
743+
744+sst.actions.set_base_url('http://localhost:%s/' % DEVSERVER_PORT)
745+assert sst.actions.get_base_url() == 'http://localhost:%s/' % DEVSERVER_PORT
746+sst.actions.go_to('/')
747
748 # assert_url adds the base url for relative urls
749 # so test both ways
750-assert_url('http://localhost:%s/' % DEVSERVER_PORT)
751-assert_url('/')
752-
753-fails(assert_url, '/begin/')
754-
755-reset_base_url()
756-assert get_base_url() == 'http://localhost:%s/' % DEVSERVER_PORT
757-go_to('/')
758-assert_url('http://localhost:%s/' % DEVSERVER_PORT)
759+sst.actions.assert_url('http://localhost:%s/' % DEVSERVER_PORT)
760+sst.actions.assert_url('/')
761+
762+sst.actions.fails(sst.actions.assert_url, '/begin/')
763+
764+sst.actions.reset_base_url()
765+assert sst.actions.get_base_url() == 'http://localhost:%s/' % DEVSERVER_PORT
766+sst.actions.go_to('/')
767+sst.actions.assert_url('http://localhost:%s/' % DEVSERVER_PORT)
768
769 # assert_url works also without the trailing slash
770-assert_url('http://localhost:%s' % DEVSERVER_PORT)
771+sst.actions.assert_url('http://localhost:%s' % DEVSERVER_PORT)
772
773=== modified file 'src/sst/selftests/unicode.py'
774--- src/sst/selftests/unicode.py 2013-04-16 15:25:57 +0000
775+++ src/sst/selftests/unicode.py 2013-04-19 08:09:29 +0000
776@@ -1,24 +1,24 @@
777-from sst.actions import *
778+import sst.actions
779 from sst import config
780
781 # currently failing in Chrome.
782 # need to investigate and file upstream chromedriver bug.
783 if config.browser_type == 'chrome':
784- skip()
785+ sst.actions.skip()
786
787-go_to('/')
788+sst.actions.go_to('/')
789
790 u = u'abcdéשאלק'
791-write_textfield('text_1', u)
792-assert_text('text_1', u)
793-assert_text_contains('text_1', u)
794+sst.actions.write_textfield('text_1', u)
795+sst.actions.assert_text('text_1', u)
796+sst.actions.assert_text_contains('text_1', u)
797
798 u = u'\u05e9\u05d0\u05dc\u05e7'
799-write_textfield('text_1', u)
800-assert_text('text_1', u)
801-assert_text_contains('text_1', u)
802+sst.actions.write_textfield('text_1', u)
803+sst.actions.assert_text('text_1', u)
804+sst.actions.assert_text_contains('text_1', u)
805
806 u = unichr(40960) + u'abcd' + unichr(1972)
807-write_textfield('text_1', u)
808-assert_text('text_1', u)
809-assert_text_contains('text_1', u)
810+sst.actions.write_textfield('text_1', u)
811+sst.actions.assert_text('text_1', u)
812+sst.actions.assert_text_contains('text_1', u)
813
814=== modified file 'src/sst/selftests/wait_timeout.py'
815--- src/sst/selftests/wait_timeout.py 2012-09-30 05:49:34 +0000
816+++ src/sst/selftests/wait_timeout.py 2013-04-19 08:09:29 +0000
817@@ -1,8 +1,8 @@
818-from sst.actions import *
819-
820-
821-set_wait_timeout(10)
822-assert get_wait_timeout() == 10
823-
824-set_wait_timeout(20)
825-assert get_wait_timeout() == 20
826+import sst.actions
827+
828+
829+sst.actions.set_wait_timeout(10)
830+assert sst.actions.get_wait_timeout() == 10
831+
832+sst.actions.set_wait_timeout(20)
833+assert sst.actions.get_wait_timeout() == 20
834
835=== modified file 'src/sst/selftests/waitfor.py'
836--- src/sst/selftests/waitfor.py 2013-04-16 13:28:31 +0000
837+++ src/sst/selftests/waitfor.py 2013-04-19 08:09:29 +0000
838@@ -1,4 +1,4 @@
839-from sst.actions import *
840+import sst.actions
841 from time import time
842
843
844@@ -27,38 +27,38 @@
845 return False
846 return condition
847
848-go_to('/')
849-set_wait_timeout(0.1)
850-
851-wait_for(get_condition(True))
852-fails(wait_for, get_condition(False))
853-
854-wait_for(get_condition(raises=True))
855-fails(wait_for, get_condition(False, raises=True))
856-
857-wait_for(assert_url, '/')
858-fails(wait_for, assert_url, '/thing')
859-
860-wait_for(assert_url, url='/')
861-fails(wait_for, assert_url, url='/thing')
862+sst.actions.go_to('/')
863+sst.actions.set_wait_timeout(0.1)
864+
865+sst.actions.wait_for(get_condition(True))
866+sst.actions.fails(sst.actions.wait_for, get_condition(False))
867+
868+sst.actions.wait_for(get_condition(raises=True))
869+sst.actions.fails(sst.actions.wait_for, get_condition(False, raises=True))
870+
871+sst.actions.wait_for(sst.actions.assert_url, '/')
872+sst.actions.fails(sst.actions.wait_for, sst.actions.assert_url, '/thing')
873+
874+sst.actions.wait_for(sst.actions.assert_url, url='/')
875+sst.actions.fails(sst.actions.wait_for, sst.actions.assert_url, url='/thing')
876
877 CALLS = 0
878-set_wait_timeout(0.1, 0.01)
879-fails(wait_for, get_condition(wait=0.2))
880+sst.actions.set_wait_timeout(0.1, 0.01)
881+sst.actions.fails(sst.actions.wait_for, get_condition(wait=0.2))
882 assert CALLS > 6
883
884-fails(wait_for, get_condition(wait=0.2, raises=True))
885-
886-set_wait_timeout(0.5)
887-wait_for(get_condition(wait=0.2))
888-wait_for(get_condition(wait=0.2, raises=True))
889-
890-set_wait_timeout(0.3, 0.1)
891+sst.actions.fails(sst.actions.wait_for, get_condition(wait=0.2, raises=True))
892+
893+sst.actions.set_wait_timeout(0.5)
894+sst.actions.wait_for(get_condition(wait=0.2))
895+sst.actions.wait_for(get_condition(wait=0.2, raises=True))
896+
897+sst.actions.set_wait_timeout(0.3, 0.1)
898 CALLS = 0
899-wait_for(get_condition(wait=0.2))
900+sst.actions.wait_for(get_condition(wait=0.2))
901 assert CALLS <= 3
902
903-set_wait_timeout(5, 0.1)
904+sst.actions.set_wait_timeout(5, 0.1)
905
906-wait_for_and_refresh(get_condition(True))
907-fails(wait_for_and_refresh, get_condition(False))
908+sst.actions.wait_for_and_refresh(get_condition(True))
909+sst.actions.fails(sst.actions.wait_for_and_refresh, get_condition(False))
910
911=== modified file 'src/sst/selftests/window_close.py'
912--- src/sst/selftests/window_close.py 2013-04-16 15:25:57 +0000
913+++ src/sst/selftests/window_close.py 2013-04-19 08:09:29 +0000
914@@ -1,21 +1,21 @@
915-from sst.actions import *
916+import sst.actions
917 from sst import config
918
919 # PhantomJS can not do multiple windows by design
920 if config.browser_type == 'phantomjs':
921- skip()
922+ sst.actions.skip()
923
924-go_to('/')
925-click_link('popup_link')
926+sst.actions.go_to('/')
927+sst.actions.click_link('popup_link')
928
929 # switch to new window/tab and close it
930-switch_to_window(index_or_name='_NEW_WINDOW')
931-assert_title('Popup Window')
932-close_window()
933+sst.actions.switch_to_window(index_or_name='_NEW_WINDOW')
934+sst.actions.assert_title('Popup Window')
935+sst.actions.close_window()
936
937 # switch back to default/main window/tab
938-switch_to_window()
939-assert_title('The Page Title')
940+sst.actions.switch_to_window()
941+sst.actions.assert_title('The Page Title')
942
943 # fails because the window no longer exists
944-fails(switch_to_window, index_or_name='NEW_WINDOW')
945+sst.actions.fails(sst.actions.switch_to_window, index_or_name='NEW_WINDOW')
946
947=== modified file 'src/sst/selftests/window_size.py'
948--- src/sst/selftests/window_size.py 2013-01-09 23:40:44 +0000
949+++ src/sst/selftests/window_size.py 2013-04-19 08:09:29 +0000
950@@ -1,38 +1,38 @@
951-from sst.actions import *
952-
953-
954-width, height = get_window_size()
955+import sst.actions
956+
957+
958+width, height = sst.actions.get_window_size()
959 assert isinstance(width, int)
960 assert isinstance(height, int)
961 assert width > 0
962 assert height > 0
963
964-expected_width, expected_height = set_window_size(200, 300)
965-width, height = get_window_size()
966+expected_width, expected_height = sst.actions.set_window_size(200, 300)
967+width, height = sst.actions.get_window_size()
968 assert isinstance(expected_width, int)
969 assert isinstance(expected_height, int)
970 assert width == expected_width == 200
971 assert height == expected_height == 300
972
973-expected_width, expected_height = set_window_size(450, 420)
974-width, height = get_window_size()
975+expected_width, expected_height = sst.actions.set_window_size(450, 420)
976+width, height = sst.actions.get_window_size()
977 assert width == expected_width == 450
978 assert height == expected_height == 420
979
980-expected_width, expected_height = set_window_size(380, 320)
981+expected_width, expected_height = sst.actions.set_window_size(380, 320)
982 # set window to same size
983-set_window_size(380, 320)
984-width, height = get_window_size()
985+sst.actions.set_window_size(380, 320)
986+width, height = sst.actions.get_window_size()
987 assert width == expected_width == 380
988 assert height == expected_height == 320
989
990-go_to('/')
991+sst.actions.go_to('/')
992
993 # switch to new window/tab and resize it
994-click_link('popup_link')
995-switch_to_window(index_or_name='_NEW_WINDOW')
996-assert_title('Popup Window')
997-expected_width, expected_height = set_window_size(260, 275)
998-width, height = get_window_size()
999+sst.actions.click_link('popup_link')
1000+sst.actions.switch_to_window(index_or_name='_NEW_WINDOW')
1001+sst.actions.assert_title('Popup Window')
1002+expected_width, expected_height = sst.actions.set_window_size(260, 275)
1003+width, height = sst.actions.get_window_size()
1004 assert width == expected_width == 260
1005 assert height == expected_height == 275
1006
1007=== modified file 'src/sst/selftests/yui.py'
1008--- src/sst/selftests/yui.py 2011-12-07 19:35:25 +0000
1009+++ src/sst/selftests/yui.py 2013-04-19 08:09:29 +0000
1010@@ -1,5 +1,5 @@
1011-from sst.actions import *
1012-
1013-go_to('/yui')
1014-
1015-write_textfield('text_with_default_value', '25', check=True)
1016+import sst.actions
1017+
1018+sst.actions.go_to('/yui')
1019+
1020+sst.actions.write_textfield('text_with_default_value', '25', check=True)

Subscribers

People subscribed via source and target branches