Merge lp:~bjornt/launchpad/bug-415336 into lp:launchpad

Proposed by Björn Tillenius
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~bjornt/launchpad/bug-415336
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~bjornt/launchpad/bug-415336
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+10362@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Björn Tillenius (bjornt) wrote :

Make test_duplicate_finder windmill test pass. The way the collapsible
are shown and hidden had changed, so that the display style property
isn't set to hidden anymore. Instead I check the height of the div. It's
a bit troublesome checking whether the div is hidden, since the height
depends on the font being used, so I did it using javascript to ensure
it's not 0px.

I also changed the start URL to be on the bugs domain, since that caused
a strange failure, probably due to cross-domain posting. This seemed to
be a windmill problem, in a real instance it's ok to start on a non-bugs
domain.

--
Björn Tillenius | https://launchpad.net/~bjornt

Revision history for this message
Gavin Panella (allenap) wrote :
Download full text (3.9 KiB)

It's good to have these fixed :)

One small ateration and it's all good.

Gavin.

> === modified file 'lib/lp/bugs/windmill/tests/test_bugs/test_filebug_dupe_finder.py'
> --- lib/lp/bugs/windmill/tests/test_bugs/test_filebug_dupe_finder.py 2009-06-25 00:40:31 +0000
> +++ lib/lp/bugs/windmill/tests/test_bugs/test_filebug_dupe_finder.py 2009-08-19 08:53:28 +0000
> @@ -8,7 +8,7 @@
> WAIT_PAGELOAD = u'20000'
> WAIT_ELEMENT_COMPLETE = u'20000'
> WAIT_CHECK_CHANGE = u'1000'
> -FILEBUG_URL = 'http://launchpad.dev:8085/firefox/+filebug'
> +FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'
>
> FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/table'
> FORM_OVERLAY_CANCEL = (
> @@ -24,6 +24,9 @@
> FORM_VISIBLE = (
> u'element.className.search("yui-lazr-formoverlay-hidden") == -1')
>
> +BUG_INFO_HIDDEN = 'style.height|0px'
> +BUG_INFO_SHOWN_JS = 'element.style.height != "0px"'
> +
>
> def test_duplicate_finder():
> """Test the +filebug duplicate finder.
> @@ -47,10 +50,9 @@
> client.type(text=u'problem', id=u'field.title')
> client.click(xpath=u'//input[@id="field.actions.search"]')
> client.waits.forPageLoad(timeout=WAIT_PAGELOAD)
> -
> # The details div for the duplicate bug should not be shown.
> client.asserts.assertProperty(
> - id='details-for-bug-4', validator='style.display|none')
> + id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
>
> # The expander for the duplicate should be collapsed.
> client.asserts.assertProperty(
> @@ -64,8 +66,8 @@
> client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)
> client.asserts.assertProperty(
> id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
> - client.asserts.assertProperty(
> - id='details-for-bug-4', validator='style.display|block')
> + client.asserts.assertElemJS(
> + id='details-for-bug-4', js=BUG_INFO_SHOWN_JS)
>
> # Clicking the expander again will hide the details div and collapse
> # the expander.
> @@ -74,15 +76,15 @@
> client.asserts.assertProperty(
> id='bug-details-expander-bug-4', validator='src|/@@/treeCollapsed')
> client.asserts.assertProperty(
> - id='details-for-bug-4', validator='style.display|none')
> + id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
>
> # Clicking it yet again will reopen it.
> client.click(id='bug-details-expander-bug-4')
> client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)
> client.asserts.assertProperty(
> id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
> - client.asserts.assertProperty(
> - id='details-for-bug-4', validator='style.display|block')
> + client.asserts.assertElemJS(
> + id='details-for-bug-4', js='element.style.height != "0px"')

I guess this should be: js=BUG_INFO_SHOWN_JS

>
> # Clicking "No, I need to file a new bug" will collapse the
> # duplicate details and expander and will show the filebug form.
> @@ -91,7 +93,7 @@
> client.asserts.assertProperty(
> id='bug-details-expander-bug-4', validator='src|/@@/treeCollapsed')
> client.asserts.assertProperty(
> - id='det...

Read more...

review: Approve
Revision history for this message
Björn Tillenius (bjornt) wrote :

On Wed, Aug 19, 2009 at 09:09:58AM -0000, Gavin Panella wrote:
> Review: Approve
> It's good to have these fixed :)
>
> One small ateration and it's all good.
>
> Gavin.
>
>
> > === modified file 'lib/lp/bugs/windmill/tests/test_bugs/test_filebug_dupe_finder.py'
> > --- lib/lp/bugs/windmill/tests/test_bugs/test_filebug_dupe_finder.py 2009-06-25 00:40:31 +0000
> > +++ lib/lp/bugs/windmill/tests/test_bugs/test_filebug_dupe_finder.py 2009-08-19 08:53:28 +0000
> > @@ -8,7 +8,7 @@
> > WAIT_PAGELOAD = u'20000'
> > WAIT_ELEMENT_COMPLETE = u'20000'
> > WAIT_CHECK_CHANGE = u'1000'
> > -FILEBUG_URL = 'http://launchpad.dev:8085/firefox/+filebug'
> > +FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'
> >
> > FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/table'
> > FORM_OVERLAY_CANCEL = (
> > @@ -24,6 +24,9 @@
> > FORM_VISIBLE = (
> > u'element.className.search("yui-lazr-formoverlay-hidden") == -1')
> >
> > +BUG_INFO_HIDDEN = 'style.height|0px'
> > +BUG_INFO_SHOWN_JS = 'element.style.height != "0px"'
> > +
> >
> > def test_duplicate_finder():
> > """Test the +filebug duplicate finder.
> > @@ -47,10 +50,9 @@
> > client.type(text=u'problem', id=u'field.title')
> > client.click(xpath=u'//input[@id="field.actions.search"]')
> > client.waits.forPageLoad(timeout=WAIT_PAGELOAD)
> > -
> > # The details div for the duplicate bug should not be shown.
> > client.asserts.assertProperty(
> > - id='details-for-bug-4', validator='style.display|none')
> > + id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
> >
> > # The expander for the duplicate should be collapsed.
> > client.asserts.assertProperty(
> > @@ -64,8 +66,8 @@
> > client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)
> > client.asserts.assertProperty(
> > id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
> > - client.asserts.assertProperty(
> > - id='details-for-bug-4', validator='style.display|block')
> > + client.asserts.assertElemJS(
> > + id='details-for-bug-4', js=BUG_INFO_SHOWN_JS)
> >
> > # Clicking the expander again will hide the details div and collapse
> > # the expander.
> > @@ -74,15 +76,15 @@
> > client.asserts.assertProperty(
> > id='bug-details-expander-bug-4', validator='src|/@@/treeCollapsed')
> > client.asserts.assertProperty(
> > - id='details-for-bug-4', validator='style.display|none')
> > + id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
> >
> > # Clicking it yet again will reopen it.
> > client.click(id='bug-details-expander-bug-4')
> > client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)
> > client.asserts.assertProperty(
> > id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
> > - client.asserts.assertProperty(
> > - id='details-for-bug-4', validator='style.display|block')
> > + client.asserts.assertElemJS(
> > + id='details-for-bug-4', js='element.style.height != "0px"')
>
> I guess this should be: js=BUG_INFO_SHOWN_JS

Right, good catch.

--
Björn Tillenius | https://launchpad.net/~bjornt

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_bugs/test_filebug_dupe_finder.py'
2--- lib/lp/bugs/windmill/tests/test_bugs/test_filebug_dupe_finder.py 2009-06-25 00:40:31 +0000
3+++ lib/lp/bugs/windmill/tests/test_bugs/test_filebug_dupe_finder.py 2009-08-19 08:18:10 +0000
4@@ -8,7 +8,7 @@
5 WAIT_PAGELOAD = u'20000'
6 WAIT_ELEMENT_COMPLETE = u'20000'
7 WAIT_CHECK_CHANGE = u'1000'
8-FILEBUG_URL = 'http://launchpad.dev:8085/firefox/+filebug'
9+FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'
10
11 FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/table'
12 FORM_OVERLAY_CANCEL = (
13@@ -24,6 +24,9 @@
14 FORM_VISIBLE = (
15 u'element.className.search("yui-lazr-formoverlay-hidden") == -1')
16
17+BUG_INFO_HIDDEN = 'style.height|0px'
18+BUG_INFO_SHOWN_JS = 'element.style.height != "0px"'
19+
20
21 def test_duplicate_finder():
22 """Test the +filebug duplicate finder.
23@@ -47,10 +50,9 @@
24 client.type(text=u'problem', id=u'field.title')
25 client.click(xpath=u'//input[@id="field.actions.search"]')
26 client.waits.forPageLoad(timeout=WAIT_PAGELOAD)
27-
28 # The details div for the duplicate bug should not be shown.
29 client.asserts.assertProperty(
30- id='details-for-bug-4', validator='style.display|none')
31+ id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
32
33 # The expander for the duplicate should be collapsed.
34 client.asserts.assertProperty(
35@@ -64,8 +66,8 @@
36 client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)
37 client.asserts.assertProperty(
38 id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
39- client.asserts.assertProperty(
40- id='details-for-bug-4', validator='style.display|block')
41+ client.asserts.assertElemJS(
42+ id='details-for-bug-4', js=BUG_INFO_SHOWN_JS)
43
44 # Clicking the expander again will hide the details div and collapse
45 # the expander.
46@@ -74,15 +76,15 @@
47 client.asserts.assertProperty(
48 id='bug-details-expander-bug-4', validator='src|/@@/treeCollapsed')
49 client.asserts.assertProperty(
50- id='details-for-bug-4', validator='style.display|none')
51+ id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
52
53 # Clicking it yet again will reopen it.
54 client.click(id='bug-details-expander-bug-4')
55 client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)
56 client.asserts.assertProperty(
57 id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
58- client.asserts.assertProperty(
59- id='details-for-bug-4', validator='style.display|block')
60+ client.asserts.assertElemJS(
61+ id='details-for-bug-4', js='element.style.height != "0px"')
62
63 # Clicking "No, I need to file a new bug" will collapse the
64 # duplicate details and expander and will show the filebug form.
65@@ -91,7 +93,7 @@
66 client.asserts.assertProperty(
67 id='bug-details-expander-bug-4', validator='src|/@@/treeCollapsed')
68 client.asserts.assertProperty(
69- id='details-for-bug-4', validator='style.display|none')
70+ id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
71 client.asserts.assertProperty(
72 id='bug_reporting_form', validator='style.display|block')
73
74@@ -103,8 +105,8 @@
75 id='bug_reporting_form', validator='style.display|none')
76 client.asserts.assertProperty(
77 id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
78- client.asserts.assertProperty(
79- id='details-for-bug-4', validator='style.display|block')
80+ client.asserts.assertElemJS(
81+ id='details-for-bug-4', js=BUG_INFO_SHOWN_JS)
82
83 # Clicking on the "Yes, this is my bug button" will show a form
84 # overlay, which will offer the user the option to subscribe to the