Merge lp:~rockstar/launchpad/fix-ensure-login into lp:launchpad

Proposed by Paul Hummer
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~rockstar/launchpad/fix-ensure-login
Merge into: lp:launchpad
Diff against target: 13 lines
1 file modified
lib/canonical/launchpad/windmill/testing/lpuser.py (+2/-1)
To merge this branch: bzr merge lp:~rockstar/launchpad/fix-ensure-login
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code Approve
Review via email: mp+13373@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

Hi Edwin-

  When BaseWindmillLayer tests came about, we started consolidating our test
functions into TestCase classes. In the code team, we noticed that if you
have more than one test method in the same class, subsequent ensure_login calls
fail.

  Upon further inspection, it looks like waitsForPageLoad doesn't always work
right (I'll chase this with the Windmill folks). The fix for this is to make
the test wait for the actual element it needs instead.

  The way I was tested is this:

for i in `seq 5`;
do
bin/test -v --layer=CodeWindmillLayer test_branch_subscriptions
done

  Basically, run the tests 5 times. I knew I was done when there was no failure.

Cheers,
Paul

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Good improvement.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/windmill/testing/lpuser.py'
2--- lib/canonical/launchpad/windmill/testing/lpuser.py 2009-09-30 21:03:52 +0000
3+++ lib/canonical/launchpad/windmill/testing/lpuser.py 2009-10-14 19:05:25 +0000
4@@ -29,7 +29,8 @@
5 # We are logged as that user.
6 return
7 client.click(name="logout")
8- client.waits.forPageLoad(timeout=u'20000')
9+ client.waits.forElement(
10+ link=u'Log in / Register', timeout=u'20000')
11 client.click(link=u'Log in / Register')
12 client.waits.forPageLoad(timeout=u'20000')
13 client.waits.forElement(timeout=u'8000', id=u'email')