Closed Bug 635421 Opened 13 years ago Closed 13 years ago

Failure in testSubmitUnencryptedInfoWarning.js due to missing searchbox

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: u279076, Assigned: u279076)

References

()

Details

(Whiteboard: [mozmill-test-failure])

Attachments

(2 files, 1 obsolete file)

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.
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.
(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
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").
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.
I believe I found something...

https://www.mozilla.org seems to display the warning.  Checking now to see if it works for this test.
Attached patch Patch v1 (obsolete) — Splinter Review
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+
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?
Patch for check-in with nit addressed.
Attachment #514316 - Attachment is obsolete: true
Attachment #514824 - Flags: review+
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]
Backport patch.
Attachment #514827 - Flags: review?(hskupin)
Attachment #514827 - Flags: review?(hskupin) → review+
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]
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: