Merge lp:~canonical-isd-hackers/selenium-simple-test/fix-exists-element into lp:selenium-simple-test

Proposed by Łukasz Czyżykowski
Status: Merged
Approved by: Michael Foord
Approved revision: 152
Merged at revision: 153
Proposed branch: lp:~canonical-isd-hackers/selenium-simple-test/fix-exists-element
Merge into: lp:selenium-simple-test
Diff against target: 28 lines (+11/-2)
2 files modified
src/sst/actions.py (+5/-2)
src/sst/selftests/exists_element.py (+6/-0)
To merge this branch: bzr merge lp:~canonical-isd-hackers/selenium-simple-test/fix-exists-element
Reviewer Review Type Date Requested Status
Corey Goldberg (community) Approve
Michael Foord (community) Approve
Review via email: mp+70428@code.launchpad.net

Commit message

Fix exists_element to always return boolean.

Description of the change

This branch fixes exists_element to always return boolean.

To post a comment you must log in.
Revision history for this message
Michael Foord (mfoord) wrote :

Thank you

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sst/actions.py'
2--- src/sst/actions.py 2011-08-03 10:31:54 +0000
3+++ src/sst/actions.py 2011-08-04 12:11:24 +0000
4@@ -621,8 +621,11 @@
5 provide, the call will fail with an exception.
6
7 You can specify as many or as few attributes as you like."""
8- get_elements(tag=tag, css_class=css_class, id=id, text=text, **kwargs)
9- return True
10+ try:
11+ get_elements(tag=tag, css_class=css_class, id=id, text=text, **kwargs)
12+ return True
13+ except AssertionError:
14+ return False
15
16
17 def is_button(id_or_elem):
18
19=== added file 'src/sst/selftests/exists_element.py'
20--- src/sst/selftests/exists_element.py 1970-01-01 00:00:00 +0000
21+++ src/sst/selftests/exists_element.py 2011-08-04 12:11:24 +0000
22@@ -0,0 +1,6 @@
23+from sst.actions import *
24+
25+goto('/')
26+
27+assert exists_element(id='select_with_id_1')
28+assert not exists_element(id='non_existing_element')

Subscribers

People subscribed via source and target branches