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
=== 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:18:10 +0000
@@ -8,7 +8,7 @@
8WAIT_PAGELOAD = u'20000'8WAIT_PAGELOAD = u'20000'
9WAIT_ELEMENT_COMPLETE = u'20000'9WAIT_ELEMENT_COMPLETE = u'20000'
10WAIT_CHECK_CHANGE = u'1000'10WAIT_CHECK_CHANGE = u'1000'
11FILEBUG_URL = 'http://launchpad.dev:8085/firefox/+filebug'11FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'
1212
13FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/table'13FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/table'
14FORM_OVERLAY_CANCEL = (14FORM_OVERLAY_CANCEL = (
@@ -24,6 +24,9 @@
24FORM_VISIBLE = (24FORM_VISIBLE = (
25 u'element.className.search("yui-lazr-formoverlay-hidden") == -1')25 u'element.className.search("yui-lazr-formoverlay-hidden") == -1')
2626
27BUG_INFO_HIDDEN = 'style.height|0px'
28BUG_INFO_SHOWN_JS = 'element.style.height != "0px"'
29
2730
28def test_duplicate_finder():31def test_duplicate_finder():
29 """Test the +filebug duplicate finder.32 """Test the +filebug duplicate finder.
@@ -47,10 +50,9 @@
47 client.type(text=u'problem', id=u'field.title')50 client.type(text=u'problem', id=u'field.title')
48 client.click(xpath=u'//input[@id="field.actions.search"]')51 client.click(xpath=u'//input[@id="field.actions.search"]')
49 client.waits.forPageLoad(timeout=WAIT_PAGELOAD)52 client.waits.forPageLoad(timeout=WAIT_PAGELOAD)
50
51 # The details div for the duplicate bug should not be shown.53 # The details div for the duplicate bug should not be shown.
52 client.asserts.assertProperty(54 client.asserts.assertProperty(
53 id='details-for-bug-4', validator='style.display|none')55 id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
5456
55 # The expander for the duplicate should be collapsed.57 # The expander for the duplicate should be collapsed.
56 client.asserts.assertProperty(58 client.asserts.assertProperty(
@@ -64,8 +66,8 @@
64 client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)66 client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)
65 client.asserts.assertProperty(67 client.asserts.assertProperty(
66 id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')68 id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
67 client.asserts.assertProperty(69 client.asserts.assertElemJS(
68 id='details-for-bug-4', validator='style.display|block')70 id='details-for-bug-4', js=BUG_INFO_SHOWN_JS)
6971
70 # Clicking the expander again will hide the details div and collapse72 # Clicking the expander again will hide the details div and collapse
71 # the expander.73 # the expander.
@@ -74,15 +76,15 @@
74 client.asserts.assertProperty(76 client.asserts.assertProperty(
75 id='bug-details-expander-bug-4', validator='src|/@@/treeCollapsed')77 id='bug-details-expander-bug-4', validator='src|/@@/treeCollapsed')
76 client.asserts.assertProperty(78 client.asserts.assertProperty(
77 id='details-for-bug-4', validator='style.display|none')79 id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
7880
79 # Clicking it yet again will reopen it.81 # Clicking it yet again will reopen it.
80 client.click(id='bug-details-expander-bug-4')82 client.click(id='bug-details-expander-bug-4')
81 client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)83 client.waits.sleep(milliseconds=WAIT_CHECK_CHANGE)
82 client.asserts.assertProperty(84 client.asserts.assertProperty(
83 id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')85 id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
84 client.asserts.assertProperty(86 client.asserts.assertElemJS(
85 id='details-for-bug-4', validator='style.display|block')87 id='details-for-bug-4', js='element.style.height != "0px"')
8688
87 # Clicking "No, I need to file a new bug" will collapse the89 # Clicking "No, I need to file a new bug" will collapse the
88 # duplicate details and expander and will show the filebug form.90 # duplicate details and expander and will show the filebug form.
@@ -91,7 +93,7 @@
91 client.asserts.assertProperty(93 client.asserts.assertProperty(
92 id='bug-details-expander-bug-4', validator='src|/@@/treeCollapsed')94 id='bug-details-expander-bug-4', validator='src|/@@/treeCollapsed')
93 client.asserts.assertProperty(95 client.asserts.assertProperty(
94 id='details-for-bug-4', validator='style.display|none')96 id='details-for-bug-4', validator=BUG_INFO_HIDDEN)
95 client.asserts.assertProperty(97 client.asserts.assertProperty(
96 id='bug_reporting_form', validator='style.display|block')98 id='bug_reporting_form', validator='style.display|block')
9799
@@ -103,8 +105,8 @@
103 id='bug_reporting_form', validator='style.display|none')105 id='bug_reporting_form', validator='style.display|none')
104 client.asserts.assertProperty(106 client.asserts.assertProperty(
105 id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')107 id='bug-details-expander-bug-4', validator='src|/@@/treeExpanded')
106 client.asserts.assertProperty(108 client.asserts.assertElemJS(
107 id='details-for-bug-4', validator='style.display|block')109 id='details-for-bug-4', js=BUG_INFO_SHOWN_JS)
108110
109 # Clicking on the "Yes, this is my bug button" will show a form111 # Clicking on the "Yes, this is my bug button" will show a form
110 # overlay, which will offer the user the option to subscribe to the112 # overlay, which will offer the user the option to subscribe to the