Robocop: Add test for Share Link option from the Firefox Mobile Menu

RESOLVED FIXED in Firefox 20

Status

()

defect
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: AdrianT, Assigned: AdrianT)

Tracking

Trunk
Firefox 20
ARM
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

Assignee

Description

7 years ago
Posted patch Share Link test (obsolete) — Splinter Review
This Robocop test covers the share link feature. It tests that all available share options are displayed in the share options list.

Moztrap test case: https://moztrap.mozilla.org/manage/case/295/
Assignee

Updated

7 years ago
Attachment #697430 - Flags: review?(jmaher)
Comment on attachment 697430 [details] [diff] [review]
Share Link test

Review of attachment 697430 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/tests/testShareLink.java.in
@@ +96,5 @@
> +    }
> +
> +    private boolean optionDisplayed(String shareOption, ArrayList<String> displayedOptions) {
> +        for (String displayedOption: displayedOptions) {
> +            if (shareOption == displayedOption) {

Use .equals in preference to == for string comparison.

@@ +115,5 @@
> +                       return true;
> +               }
> +               return false;
> +            }
> +        }, WAIT_FOR_TEST_TIMEOUT);

Use BaseTest.MAX_WAIT_MS - https://hg.mozilla.org/mozilla-central/file/6955309291ee/mobile/android/base/tests/BaseTest.java.in#l35 - unless you really need a different timeout value.
Assignee

Comment 2

7 years ago
Posted patch Share Link test v1.1 (obsolete) — Splinter Review
Made the changes requested by Geoff
Attachment #697430 - Attachment is obsolete: true
Attachment #697430 - Flags: review?(jmaher)
Attachment #697438 - Flags: review?(jmaher)
Comment on attachment 697438 [details] [diff] [review]
Share Link test v1.1

Review of attachment 697438 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patch.

please upload a new patch with the nit's addressed and I can land.  This passes consistently while running locally!

::: mobile/android/base/tests/testShareLink.java.in
@@ +51,5 @@
> +        }
> +        return shareOptions;
> +    }
> +
> +    public void verifyOptions(ArrayList<String> shareOptions){

nit: space between ){

@@ +53,5 @@
> +    }
> +
> +    public void verifyOptions(ArrayList<String> shareOptions){
> +        Device device = new Device();
> +        if (device.version == "2.x") {

how about "device.version.equals("2.x")"

@@ +58,5 @@
> +            ArrayList<String> displayedOptions = new ArrayList();
> +            ListView shareMenu = getDisplayedShareList();
> +
> +            /* Will have to go in the ListView, get each child, for the child separate the icon and the label
> +            and from the label get the label text in a String Array */

nit: align the two lines of text: 
/* Will ..
   and ... */

@@ +59,5 @@
> +            ListView shareMenu = getDisplayedShareList();
> +
> +            /* Will have to go in the ListView, get each child, for the child separate the icon and the label
> +            and from the label get the label text in a String Array */
> +            for (int i = 0; i < shareMenu.getAdapter().getCount();i++){

nit: space between ){

@@ +82,5 @@
> +            }
> +
> +            for (String option:shareOptions) {
> +                 // Verify if the option is present in the list of displayed share options
> +                 mAsserter.ok(optionDisplayed(option,displayedOptions), "Share option found", option);

nit: space between (option, displayedOptions)

@@ +118,5 @@
> +        }, MAX_WAIT_MS);
> +        mAsserter.ok(success,"Got the displayed share options?", "Got the share options list");
> +        return list;
> +    }
> +    

nit: extra whitespace.
Attachment #697438 - Flags: review?(jmaher) → review+
Assignee

Comment 4

7 years ago
Cleaned up the patch as requested
Attachment #697438 - Attachment is obsolete: true
Assignee

Updated

7 years ago
Blocks: 744859
https://hg.mozilla.org/mozilla-central/rev/5a20d8fd94cd
Assignee: nobody → adrian.tamas
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Assignee

Updated

6 years ago
Blocks: 841377
You need to log in before you can comment on or make changes to this bug.