Merge lp:~deryck/launchpad/enable-test-inline-subscriber into lp:launchpad

Proposed by Deryck Hodge
Status: Merged
Approved by: Eleanor Berger
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~deryck/launchpad/enable-test-inline-subscriber
Merge into: lp:launchpad
Diff against target: 55 lines (+11/-9)
1 file modified
lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py (+11/-9)
To merge this branch: bzr merge lp:~deryck/launchpad/enable-test-inline-subscriber
Reviewer Review Type Date Requested Status
Eleanor Berger (community) code Approve
Review via email: mp+23230@code.launchpad.net

Commit message

Re-enable test_inline_subscriber Windmill test after making subscribe someone else sections less fragile.

Description of the change

This gets the inline subscriber Windmill test working again. I have run the following a couple times with no errors now:

for i in `seq 10`; do ./bin/test -Dcvvt test_inline_subscriber; done

The two main problems originally encountered were fixed by 1) a better xpath expression for typing in the subscribe someone else widget and 2) waiting for the page to load before trying the subscribe a team test. It's this second one that was causing the problem in the original bug report, and is an obvious fix.

To post a comment you must log in.
Revision history for this message
Eleanor Berger (intellectronica) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py'
2--- lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-02-18 10:51:34 +0000
3+++ lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-04-12 14:00:56 +0000
4@@ -18,7 +18,7 @@
5 layer = BugsWindmillLayer
6 suite_name = 'Inline bug page subscribers test'
7
8- def DISABLED_test_inline_subscriber(self):
9+ def test_inline_subscriber(self):
10 # This test fails intermittently. See bug #516781.
11 """Test inline subscribing on bugs pages.
12
13@@ -85,7 +85,12 @@
14 client.click(link=u'Subscribe someone else')
15 client.waits.forElement(
16 name=u'search', timeout=FOR_ELEMENT)
17- client.type(text=u'ubuntu-team', name=u'search')
18+ client.type(
19+ text=u'ubuntu-team',
20+ xpath=u'//table[contains(@class, "yui-picker") '
21+ 'and not(contains(@class, "yui-picker-hidden"))]'
22+ '//div[@class="yui-picker-search-box"]'
23+ '/input[@name="search"]')
24 client.click(
25 xpath=u'//table[contains(@class, "yui-picker") '
26 'and not(contains(@class, "yui-picker-hidden"))]'
27@@ -94,13 +99,11 @@
28 u'//table[contains(@class, "yui-picker") '
29 'and not(contains(@class, "yui-picker-hidden"))]'
30 '//ul[@class="yui-picker-results"]/li[1]/span')
31- # sleep() seems to be the only way to get this section to pass
32- # when running all of BugsWindmillLayer.
33- client.waits.sleep(milliseconds=SLEEP)
34+ client.waits.forElement(
35+ xpath=search_result_xpath, timeout=FOR_ELEMENT)
36 client.click(xpath=search_result_xpath)
37 client.waits.forElement(
38- id=u'subscribers-links', timeout=FOR_ELEMENT)
39- client.asserts.assertNode(xpath=PERSON_LINK % u'Ubuntu Team')
40+ xpath=PERSON_LINK % u'Ubuntu Team', timeout=FOR_ELEMENT)
41
42 # If we subscribe the user again,
43 # the icon should still be the person icon.
44@@ -219,10 +222,9 @@
45 xpath=SUBSCRIPTION_LINK, validator=u'Unsubscribe')
46 # Now back to bug 5. Confirm there are 2 subscriptions.
47 client.open(url=BUG_URL % 5)
48+ client.waits.forPageLoad(timeout=PAGE_LOAD)
49 client.asserts.assertNode(
50 id='direct-subscriber-12', timeout=FOR_ELEMENT)
51- client.asserts.assertNode(
52- id='dupe-subscriber-12', timeout=FOR_ELEMENT)
53 # The first click unsubscribes the direct subscription, leaving
54 # the duplicate subscription.
55 client.click(xpath=SUBSCRIPTION_LINK)