Closed Bug 668835 Opened 13 years ago Closed 13 years ago

Add filter to get addToFirefox element for addons with versions for multiple platforms

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: vladmaniac, Assigned: whimboo)

References

Details

(Whiteboard: [lib][testday-20110701])

Attachments

(1 file, 2 obsolete files)

This is currently blocking our tests, because 

Some addons have different versions, depending on the platform
    This is how the HTML for the Add To Firefox Button looks for Last Pass
    <p class="install-button">
    <a class="button platform windows add installer" href="/firefox/downloads/latest/8542/platform:5/addon-8542-latest.xpi?src=discovery-promo" data-hash="sha256:a5a888521fd9cefcb99128dcd9f0fd75e08ba3e186c1e63ef216c2657444a7e5" target="_self">
    <a class="button platform linux add installer" href="/firefox/downloads/latest/8542/platform:2/addon-8542-latest.xpi?src=discovery-promo" data-hash="sha256:debed5b17a52f62ca98f1168bce29fe0b616aff1e76d58c8075207587b063a0f" target="_self">
    <a class="button platform mac add installer" href="/firefox/downloads/latest/8542/platform:3/addon-8542-latest.xpi?src=discovery-promo" data-hash="sha256:9aa73c5762637a09c977a6b21fa7ceb8420e91d3cacb306fbfdf224c9d3358e6" target="_self">
    <a class="button platform android add installer" href="/firefox/downloads/latest/8542/platform:7/addon-8542-latest.xpi?src=discovery-promo" data-hash="sha256:ecf4a8652426b27189febe7b48445185cbd9351bb03a8958158757854f36ac61" target="_self">
    </p>
    Only one has a CSS attribute: display: inline-block and the rest have display:none.
     
    For a regular addon this is how the HTML looks like:
    <p class="install-button">
    <a class="button add installer" href="/firefox/downloads/latest/3456/addon-3456-latest.xpi?src=discovery-promo" data-hash="sha256:c01d80d90c51b016f7540d409e29e45e1a7eb4e2b31ea02482c430754d9e3ab1" target="_self">
    </p>
     
    So when nodeCollector.queryNodes(".install-button a"); collects it, it gets all messed up. 
    This can affect all tests, and we need to fix this in the API
Blocks: 664019
Blocks: 657492
OS: Linux → All
Hardware: x86 → All
Whiteboard: [testday-20110701][shared module]
Attached patch WIP v1 (obsolete) — Splinter Review
(In reply to comment #0)
>     Only one has a CSS attribute: display: inline-block and the rest have
> display:none.

Do you mean a property on the JS object? I don't think that this is a DOM attribute. That means we would have to change the nodeCollector line in addons.js to:

nodeCollector.queryNodes(".install-button a").filterByJSProperty("display", "inline-block");

Can you check if that works?
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Attachment #543466 - Flags: feedback?(vlad.maniac)
Summary: Add method to properly get addToFirefox element for addons with versions for multiple platforms → Add filter to get addToFirefox element for addons with versions for multiple platforms
A Pivotal Tracker story has been created for this Bug: https://www.pivotaltracker.com/story/show/15283495
Vlad, I need some help. Which add-on have you seen here? I can't find any of those which have multiple buttons. Thanks
Ok, this is the LastPass Password Manager. Investigation has shown that the nodeCollector needs a filterByCSSProperty method. I will come up with a solution by tomorrow.
Depends on: 668976
Attached patch Patch v1 (obsolete) — Splinter Review
We have to use a workaround for now and work with the final computed CSS style as long as we do not have the active class set on the install button. With this patch we simply check if multiple buttons exist and filter the unwanted out.

This patch will also fix the test on bug 664019.
Attachment #543466 - Attachment is obsolete: true
Attachment #543596 - Flags: review?(gmealer)
Attachment #543466 - Flags: feedback?(vlad.maniac)
Attached patch Patch v1.1Splinter Review
I had another patch in the queue. Here the correct patch.
Attachment #543596 - Attachment is obsolete: true
Attachment #543597 - Flags: review?(gmealer)
Attachment #543596 - Flags: review?(gmealer)
Comment on attachment 543597 [details] [diff] [review]
Patch v1.1

Looks fine, please land.
Attachment #543597 - Flags: review?(gmealer) → review+
Thanks for being this quick Henrik. Sorry,  I was away for the weekend and hadn't mail access.
Status: RESOLVED → REOPENED
OS: All → Linux
Hardware: All → x86
Resolution: FIXED → ---
Any reason why you have reopened this bug? Closing as fixed again.
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
OS: Linux → All
Hardware: x86 → All
Resolution: --- → FIXED
I did not reopen the bug..dunno what happened
Status: RESOLVED → VERIFIED
OS: All → Linux
Hardware: All → x86
Same for the platform again. Please ensure to not send any changes if mid-air collision are shown by Bugzilla.
OS: Linux → All
Hardware: x86 → All
Component: Mozmill Tests → Mozmill Shared Modules
Component: Mozmill Shared Modules → Mozmill Tests
Whiteboard: [testday-20110701][shared module] → [lib]
Whiteboard: [lib] → [lib][testday-20110701]
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: