Automate litmus test Testcase ID #4602 - Paused download - Search

ASSIGNED
Assigned to

Status

()

ASSIGNED
11 years ago
11 years ago

People

(Reporter: poonaatsoc, Assigned: poonaatsoc)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 5 obsolete attachments)

(Assignee)

Description

11 years ago
Proposed type of test: chrome

Proposed location of test: toolkit/mozapps/downloads/tests/chrome
(Assignee)

Comment 1

11 years ago
Created attachment 329609 [details] [diff] [review]
v1.0
Attachment #329609 - Flags: review?(sdwilsh)
Comment on attachment 329609 [details] [diff] [review]
v1.0

does this test pass?  if so, please re-request review.
Attachment #329609 - Flags: review?(sdwilsh)
(Assignee)

Comment 3

11 years ago
Created attachment 330187 [details] [diff] [review]
v2.0

I have run the test.  The test passes.

But I have a couple of questions.  First thing I am using dummy download data.  Second should I add a focus listener for the searchbox.  Once the searchbox gains focus and the function is called, inside the function I continue with the tests.
Attachment #329609 - Attachment is obsolete: true
Attachment #330187 - Flags: review?(sdwilsh)
(Assignee)

Comment 4

11 years ago
Created attachment 330344 [details] [diff] [review]
v4.0

utils.js issue solved.  Patch updated now using the functions directly from utils.js.  The test passes
Attachment #330187 - Attachment is obsolete: true
Attachment #330344 - Flags: review?(sdwilsh)
Attachment #330187 - Flags: review?(sdwilsh)
(Assignee)

Comment 5

11 years ago
Created attachment 331480 [details] [diff] [review]
v5.0

Test updated to accommodate the new utils.js.  The test passes
Attachment #330344 - Attachment is obsolete: true
Attachment #331480 - Flags: review?(sdwilsh)
Attachment #330344 - Flags: review?(sdwilsh)
Comment on attachment 331480 [details] [diff] [review]
v5.0

>+var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
>+var dmFile = Cc["@mozilla.org/file/directory_service;1"].
>+             getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
>+dmFile.append("dm-ui-test.file");
>+dmFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
>+var gTestPath = ios.newFileURI(dmFile).spec;
s/var/let/

>+function runTest()

>+  let win = getDMWindow();
>+  if (win)
>+    win.close();
just use setCleanState();

>+      let richListItem = doc.getElementById("downloadView").children[0];
let's call this a download

>+      let searchbox = doc.getElementById("searchbox");
>+      searchbox.focus();
>+
>+      synthesizeKey("d", { }, win);
>+      synthesizeKey("o" ,{ }, win);
This is prone to failure since focus may not happen synchronously.  Please do this like this test file:
http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/downloads/tests/chrome/test_search_clearlist.xul#134

>+      let status = richListItem.getAttribute("status");
>+      ok(status.search(/Paused/i) != -1, "On entry of valid filename " +
This will fail on non en-us builds.  I suggest getting the string from the properties file.

>+      synthesizeKey("VK_BACKSPACE", { }, win);
>+      synthesizeKey("VK_BACKSPACE", { }, win);
>+      status = richListItem.getAttribute("status");
>+      ok(status.search(/Paused/i) != -1, "On removal of the downloads  " +
>+        "name from the searchbox, the paused download continues " +
>+        "to show the Paused -- [x] of [xxx] [MB/KB] string in its " +
>+        "status section");
Ditto
Attachment #331480 - Flags: review?(sdwilsh) → review-
Product: Firefox → Toolkit
(Assignee)

Comment 7

11 years ago
Created attachment 335158 [details] [diff] [review]
v6.0

Patch updated to acccomodate reviews
Attachment #331480 - Attachment is obsolete: true
Attachment #335158 - Flags: review?(sdwilsh)
Comment on attachment 335158 [details] [diff] [review]
v6.0

>+      let pausedString = sb.getString("paused");
>+      pausedString = pausedString.substring(0,6);
This also is highly dependent on only en-us
Attachment #335158 - Flags: review?(sdwilsh) → review-
(Assignee)

Comment 9

11 years ago
Created attachment 336668 [details] [diff] [review]
v7.0

Test updated.  Actually the litmus tests requires us to check the status of the download in the dm and not the download-monitor on the status bar.  I have retrieved the relevant string from download.properties.

The property holds the string - "Paused -  #".  I have done a pausedString.substring(0,10) - which retrieves the string till the space just before the '#'.  So this way it will be consistent with all languages since all updates to the download status is made after the '#' symbol.
Attachment #335158 - Attachment is obsolete: true
Attachment #336668 - Flags: review?(sdwilsh)
Comment on attachment 336668 [details] [diff] [review]
v7.0

(In reply to comment #9)
> The property holds the string - "Paused -  #".  I have done a
> pausedString.substring(0,10) - which retrieves the string till the space just
> before the '#'.  So this way it will be consistent with all languages since all
> updates to the download status is made after the '#' symbol.
That is still dependent on English - right-to-left languages simply aren't going to work.

Looking at the bug this originally is from (bug 394263), we just need to check that it is not an empty status.
Attachment #336668 - Flags: review?(sdwilsh) → review-
You need to log in before you can comment on or make changes to this bug.