Merge lp:~elopio/selenium-simple-test/fix-856154-is_link_a_tag into lp:selenium-simple-test

Proposed by Leo Arias
Status: Merged
Approved by: Corey Goldberg
Approved revision: 346
Merged at revision: 346
Proposed branch: lp:~elopio/selenium-simple-test/fix-856154-is_link_a_tag
Merge into: lp:selenium-simple-test
Diff against target: 53 lines (+8/-5)
3 files modified
src/sst/actions.py (+1/-2)
src/sst/selftests/link.py (+6/-3)
src/testproject/templates/index.html (+1/-0)
To merge this branch: bzr merge lp:~elopio/selenium-simple-test/fix-856154-is_link_a_tag
Reviewer Review Type Date Requested Status
Corey Goldberg (community) Approve
Review via email: mp+144050@code.launchpad.net

Commit message

assert_link now checks for the a tag.

Description of the change

assert_link now checks for the a tag.

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

nice.
approved.

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 2013-01-17 15:52:24 +0000
3+++ src/sst/actions.py 2013-01-21 04:44:20 +0000
4@@ -564,8 +564,7 @@
5 Raises a failure exception if the element specified doesn't exist or
6 isn't a link"""
7 link = _get_elem(id_or_elem)
8- href = link.get_attribute('href')
9- if href is None:
10+ if link.tag_name != 'a':
11 msg = 'The text %r is not part of a Link or a Link ID' \
12 % _get_text(link)
13 _raise(msg)
14
15=== modified file 'src/sst/selftests/link.py'
16--- src/sst/selftests/link.py 2012-12-16 15:25:23 +0000
17+++ src/sst/selftests/link.py 2013-01-21 04:44:20 +0000
18@@ -5,10 +5,10 @@
19 assert_link('the_band_link')
20 assert_link(get_element(id='the_band_link'))
21
22-# fails for non existent element
23+# fails for non existent element.
24 fails(assert_link, 'foobar')
25
26-# fails for element that exists but isn't a link
27+# fails for element that exists but isn't a link.
28 fails(assert_link, 'radio_with_id_1')
29
30
31@@ -27,6 +27,9 @@
32 click_link('longscroll_link')
33 assert_url('/longscroll')
34
35-# link is initially scrolled out of view
36+# link is initially scrolled out of view.
37 click_link('homepage_link_bottom')
38 assert_url('/')
39+
40+# assert a link without an href.
41+assert_link('no_href_link')
42
43=== modified file 'src/testproject/templates/index.html'
44--- src/testproject/templates/index.html 2011-12-31 04:07:20 +0000
45+++ src/testproject/templates/index.html 2013-01-21 04:44:20 +0000
46@@ -18,6 +18,7 @@
47 <p class="some_class">And yet more</p>
48
49 <a class="link class a1" id="the_band_link" href="/begin">Here is a link</a>
50+ <a id="no_href_link">Here is a link without href</a>
51
52 <div id="the_div">
53 <a class="link class a1" id="longscroll_link" name="longscroll", href="/longscroll">link to longscroll page</a>

Subscribers

People subscribed via source and target branches