Failure in testSubmitUnencryptedInfoWarning.js due to missing searchbox

RESOLVED FIXED

Status

Mozilla QA
Mozmill Tests
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: ashughes, Assigned: ashughes)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [mozmill-test-failure], URL)

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

7 years ago
With a recent update to mail.mozilla.org, we've lost the form field.  We will no longer be able to test this until we have a shadow server set up to create a secure form.

In the meantime, let's disable this test.
We should be able to use https://developer.mozilla.org/. The search field sends unencrypted data to the google search page.
(Assignee)

Comment 2

7 years ago
I can't find a reliable way to refactor this test using Dev.MO

The searchbox is still identifiable by "q", however, the search submit button has no obvious identifiers (no ID, no NAME, no LINK).

The element is:
<button type="submit">Search</button>
You can use the nodeCollector for that by specifying a CSS identifier to get the button.
(Assignee)

Comment 4

7 years ago
(In reply to comment #3)
> You can use the nodeCollector for that by specifying a CSS identifier to get
> the button.

Is there documentation or code samples for NodeCollector? I can't seem to find it.
There are no docs yet. But check the testGoogleSuggestions which is using it in a similar simple way. For the CSS spec you can check the docs for querySelector:

https://developer.mozilla.org/En/DOM/Document.querySelectorAll
(Assignee)

Comment 6

7 years ago
I'm trying to get the "button" elements of the "site-search" form but it doesn't seem to work:

  // Get a reference to the SUBMIT button in the search form
  var form = new elementslib.ID(controller.tabs.activeTab, "site-search");
  controller.waitForElement(form, gTimeout);
  
  var collector = new DOMUtils.nodeCollector(form);
  controller.waitFor(function () {
    collector.queryNodes("button");
    return collector.elements.length > 0;
  }, "Form buttons are visible - got '" + collector.elements.length + "'");

  // Use the web page search box to submit information
  var goButton = collector.elements[0];
  controller.waitForElement(goButton, gTimeout);

Maybe I'm doing something wrong, but the FORM element does have a querySelectorAll() function in DOM Inspector. 

The error I am seeing is "this._root.querySelectorAll is not a function" for collector.getNodes("button").
(Assignee)

Comment 7

7 years ago
So I fixed the problem in comment 6 by using controller.tabs.activeTab for the collector root element and "#site-search button" for the query selector.

However, I've discovered that developer.mozilla.org does not trigger the warning we are trying to test here.  I probably should have checked this before trying to solve the problem.

We will need to find a new website or disable this test until a shadow server is available.
(Assignee)

Comment 8

7 years ago
I believe I found something...

https://www.mozilla.org seems to display the warning.  Checking now to see if it works for this test.
(Assignee)

Comment 9

7 years ago
Created attachment 514316 [details] [diff] [review]
Patch v1
Attachment #514316 - Flags: review?(aaron.train)
Comment on attachment 514316 [details] [diff] [review]
Patch v1

Nit: Please keep the line at 80 characters.
Attachment #514316 - Flags: review?(aaron.train) → review+
(Assignee)

Comment 11

7 years ago
Comment on attachment 514316 [details] [diff] [review]
Patch v1

(In reply to comment #10)
> Comment on attachment 514316 [details] [diff] [review]
> Patch v1
> 
> Nit: Please keep the line at 80 characters.

Certainly. I'll change that prior to check in.  Over to Henrik for final review.
Attachment #514316 - Flags: review?(hskupin)
Comment on attachment 514316 [details] [diff] [review]
Patch v1

(In reply to comment #11)
> Certainly. I'll change that prior to check in.  Over to Henrik for final
> review.

You will always have to attach the latest version of the patch to the bug. So it would be better to update the patch immediately before asking for the next review. But yes, with that fixed r=me.
Attachment #514316 - Flags: review?(hskupin) → review+
Anthony, can we please get this fixed today?
(Assignee)

Comment 14

7 years ago
Created attachment 514824 [details] [diff] [review]
Patch v1.1 [checked-in]

Patch for check-in with nit addressed.
Attachment #514316 - Attachment is obsolete: true
Attachment #514824 - Flags: review+
(Assignee)

Comment 15

7 years ago
Comment on attachment 514824 [details] [diff] [review]
Patch v1.1 [checked-in]

Landed:
http://hg.mozilla.org/qa/mozmill-tests/rev/3e6304c697f9 [default]
Attachment #514824 - Attachment description: Patch v1.1 → Patch v1.1 [checked-in]
(Assignee)

Comment 16

7 years ago
Created attachment 514827 [details] [diff] [review]
Patch v1.1 backport [checked-in]

Backport patch.
Attachment #514827 - Flags: review?(hskupin)
Attachment #514827 - Flags: review?(hskupin) → review+
(Assignee)

Comment 17

7 years ago
Comment on attachment 514827 [details] [diff] [review]
Patch v1.1 backport [checked-in]

Landed:
http://hg.mozilla.org/qa/mozmill-tests/rev/9b9b1a001e70 [mozilla1.9.2]
http://hg.mozilla.org/qa/mozmill-tests/rev/c5c0a017a84b [mozilla1.9.1]
Attachment #514827 - Attachment description: Patch v1.1 backport → Patch v1.1 backport [checked-in]
(Assignee)

Updated

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.