Closed Bug 1174942 Opened 10 years ago Closed 10 years ago

Tests for capture doorhanger password editing

Categories

(Toolkit :: Password Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Iteration:
42.2 - Jul 27
Tracking Status
firefox41 --- affected
firefox42 --- fixed

People

(Reporter: rittme, Assigned: rittme)

References

Details

(Whiteboard: pwmgr42)

Attachments

(1 file)

We need to write some automated tests for the capture doorhanger password editing feature.
Assignee: nobody → bernardo
Status: NEW → ASSIGNED
Bug 1174942 - Tests the password editing field at the password manager capture doorhanger
Attachment #8626824 - Flags: review?(MattN+bmo)
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN https://reviewboard.mozilla.org/r/12147/#review10659 You should probably do a try push for this in case there are failures on other platforms. ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:204 (Diff revision 1) > + * We check for new logins password edits, existing logins password edits and > + * for empty username password edits. I think this part of the comment could be written in a clearer way. ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:275 (Diff revision 1) > + let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel, > + "popupshown"); Can you file a bug about the "Shown" event happening before "popupshown" in Toolkit::Notifications… ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:401 (Diff revision 1) > + PopupNotifications.panel.setAttribute("noautohide", "true"); I think this is leftover from debugging and should be removed so it doesn't interfere with tests following this one. ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:424 (Diff revision 1) > + EventUtils.synthesizeMouse(notificationElement, 20, 20, {}, browser.window); To avoid the magic numbers you could synthesize a click on one of the other elements e.g. the description with synthesizeMouseAtCenter.
Attachment #8626824 - Flags: review?(MattN+bmo) → review+
https://reviewboard.mozilla.org/r/12147/#review10659 > Can you file a bug about the "Shown" event happening before "popupshown" in Toolkit::Notifications… Filed it here: https://bugzilla.mozilla.org/show_bug.cgi?id=1178420
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN Bug 1174942 - Tests the password editing field at the password manager capture doorhanger
Attachment #8626824 - Flags: review+ → review?(MattN+bmo)
Attachment #8626824 - Flags: review?(MattN+bmo) → review+
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN https://reviewboard.mozilla.org/r/12147/#review10737 Ship It!
Attachment #8626824 - Attachment description: MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger → MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN
Attachment #8626824 - Flags: review+ → review?(MattN+bmo)
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN
Attachment #8626824 - Flags: review?(MattN+bmo) → review+
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN https://reviewboard.mozilla.org/r/12147/#review11313 ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:349 (Diff revisions 2 - 3) > + * We skip Linux for now because focusing elements on the doorhanger > + * doesn't work as expected Please include a bug number to fix the issue. ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:402 (Diff revisions 2 - 3) > + * We skip Linux for now because focusing elements on the doorhanger > + * doesn't work as expected > */ > +if(Services.appinfo.OS != "Linux") { Ditto ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:352 (Diff revisions 2 - 3) > +if(Services.appinfo.OS != "Linux") { Nit: missing space after `if`. To avoid having to change blame later when this is fixed on Linux, do an early return inside the task functions instead. You may need to put an `ok(true, …)` call if the harness complains.
Attachment #8626824 - Flags: review+ → review?(MattN+bmo)
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN
I wasn't satisfied with skipping Linux on this tests, so I spent some more time trying to figure out what was going on. Apparently in Linux we can't rely on the `Show` or the `showpopup` events. The test tried to focus the textbox that was not yet available. I used `yield ContentTaskUtils.waitForCondition(() => PopupNotifications.isPanelOpen);` to make sure the doorhanger is really open before continuing the test. Local tests on OSX and Linux worked as expected, I'm waiting for the try to confirm it's working everywhere.
Attachment #8626824 - Flags: review?(MattN+bmo) → review+
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN https://reviewboard.mozilla.org/r/12147/#review11411 If the try results are good then you can post the try link in the bug and add the checkin-needed keyword.
Depends on: 1182296
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN
Attachment #8626824 - Flags: review+ → review?(MattN+bmo)
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN https://reviewboard.mozilla.org/r/12147/#review11571 ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:393 (Diff revisions 4 - 5) > + yield ContentTaskUtils.waitForCondition(() => mainActionButton.disabled); > Assert.ok(mainActionButton.disabled, "Main action button is disabled"); These 2 lines can be combined into one: yield ContentTaskUtils.waitForCondition(() => mainActionButton.disabled, "Main action button is disabled"); ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:392 (Diff revisions 4 - 5) > + // Wait for main button to get deactivated Nit: s/deactivated/disabled/
Attachment #8626824 - Flags: review?(MattN+bmo)
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN https://reviewboard.mozilla.org/r/12147/#review11573 Ship It!
Attachment #8626824 - Flags: review+
Iteration: --- → 42.2 - Jul 27
Flags: qe-verify-
Attachment #8626824 - Flags: review+ → review?(MattN+bmo)
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN
Attachment #8626824 - Flags: review?(MattN+bmo)
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN https://reviewboard.mozilla.org/r/12147/#review12203 ::: toolkit/components/passwordmgr/test/browser/browser_notifications.js:449 (Diff revision 6) > + yield EventUtils.synthesizeMouseAtCenter(notificationIcon, {}, browser.window); browser.window? I don't know what that's referring to but I think you can omit that argument since the default value is `window` which I believe is correct in this case.
Comment on attachment 8626824 [details] MozReview Request: Bug 1174942 - Tests the password editing field at the password manager capture doorhanger. r=MattN https://reviewboard.mozilla.org/r/12147/#review12209 Ship It!
Attachment #8626824 - Flags: review+
Bernardo, the test is still intermittently failing, even on your try push. See the three comments above.
Flags: needinfo?(bernardo)
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Flags: needinfo?(bernardo)
Whiteboard: pwmgr42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: