Closed
Bug 662284
Opened 14 years ago
Closed 14 years ago
Add a helper in a shared module to retrieve Mozilla's pick of the month pane in Addons manager
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Tracking
(Not tracked)
VERIFIED
WONTFIX
People
(Reporter: vladmaniac, Unassigned)
References
Details
We need to add a helper in the shared module for discovery pane to retrieve Mozilla's pick of the month pane, from the main feature section, because the order of the panes are different from a branch to another. (for ex, you need to click Next twice to get the pane in aurora branch, and three times for beta branch)
Currently, i worked around with styles and css properties to properly retrieve the panel regardless of the branch we tests, but the solution seems a bit complicated.
>+ var panel = new elementslib.Selector(controller.window.document, "#main-feature .slider");
>+ var panelStyle = controller.window.getComputedStyle(panel.getNode(), "");
>+ var panelStyleLeft = panelStyle.getPropertyValue('left');
>+ var panelStyleLeftNumber = parseInt(panelStyleLeft.replace("-","").replace("px",""));
>+ var expectedStyle = "-" + panelStyleLeftNumber + "px";
>+
>+ while (parseInt(panelStyle.getPropertyValue('left').replace("-","").replace("px","")) < 1917) {
>+ discovery.controller.click(nextLink);
>+ controller.waitFor(function(){return (parseInt(panelStyle.getPropertyValue('left').replace("-","")
>+ .replace("px","")) !== panelStyleLeftNumber)},"Wait for panel - got '"
>+ +(parseInt(panelStyle.getPropertyValue('left').replace("-","")
>+ .replace("px","")) !== panelStyleLeftNumber) + "', expected 'true'");
>+ }
As discussed with Anthony, it would be better if we can include this in a shared module.
CCing Geo on this bug for his opinion on how best to achieve this. The simplest/quickest solution seems to be just wrapping the above code in a helper function.
OS: Linux → All
Hardware: x86 → All
One side thought on this...
> you need to click Next twice to get the pane in aurora branch, and
> three times for beta branch
If this is always the case, ie. Aurora is ALWAYS 2 clicks and Beta is ALWAYS 3 clicks, then we can simply have a slight variation in the test across branches.
Historically, we've done this with Firefox 4 vs 3.6/3.5 tests. It's perfectly acceptable to have a test which varies slightly across the branches.
Geo, what are your thoughts on this?
I agree with you.
The above code is very complex, and would at least have to be commented within an inch of its life (though using named vars inside the waitfor instead of bare property calls would have helped considerably).
Given a choice between that and a variation between branches, it's a pretty easy decision. We should generally only use "figure it out at runtime" code like the above when something varies according to situation or locale, not when it varies according to version.
| Reporter | ||
Comment 4•14 years ago
|
||
Ok guys so we will have separate tests according to each branch
OS: All → Linux
Hardware: All → x86
| Reporter | ||
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Comment 5•14 years ago
|
||
The code as given in comment 0 is not the right way to get that fixed properly. For a better solution we should require a property which gets set each time the visible entry changes. David Burns could help us here to get this implemented.
Further as talked before we can NOT land those tests on aurora due to the nature of the discovery pane code. Whenever the version number for aurora builds gets bumped, all the tests will fail because there is no or less add-ons available. We can only run those tests on mozilla-beta, mozilla-release, and the individual release branches.
Updated•6 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•