Closed Bug 1404227 Opened 7 years ago Closed 7 years ago

Enhance test for network logs in the Console panel

Categories

(DevTools :: Console, defect, P1)

defect

Tracking

(firefox57 fix-optional, firefox58 fixed)

RESOLVED FIXED
Firefox 58
Tracking Status
firefox57 --- fix-optional
firefox58 --- fixed

People

(Reporter: Honza, Assigned: Honza)

References

Details

(Whiteboard: [reserve-console-html])

Attachments

(1 file)

The test for network logs in the Console panel:
browser_webconsole_network_messages_expand.js

... should also check existence of content in the expanded body (headers, response, timings, etc.)

(to avoid regressions like bug 1404138)

Honza
Whiteboard: [console-html][triage]
Flags: qe-verify?
Priority: -- → P3
Whiteboard: [console-html][triage] → [reserve-console-html]
Assignee: nobody → odvarko
Status: NEW → ASSIGNED
Flags: qe-verify? → qe-verify-
Priority: P3 → P1
Comment on attachment 8914695 [details]
Bug 1404227 - Enhance test for network logs in the Console panel;

https://reviewboard.mozilla.org/r/186002/#review191028

Some nits, but this looks good to me

::: devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_messages_expand.js:63
(Diff revision 1)
> +  let headersContent = messageNode.querySelector(
> +    "#headers-panel .headers-overview");
> +  ok(headersContent, "Headers content is available");
> +
> +  // Select Response tab and check the content.
> +  EventUtils.sendMouseEvent({ type: "click" }, responseTab);

nit: could we use `responseTab.click()` directly ?

::: devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_messages_expand.js:66
(Diff revision 1)
> +
> +  // Select Response tab and check the content.
> +  EventUtils.sendMouseEvent({ type: "click" }, responseTab);
> +  let responseContent = messageNode.querySelector(
> +    "#response-panel .editor-row-container");
> +  ok(responseContent, "Response content is available");

could we check that responseContent.textContent is not empty ?

::: devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_messages_expand.js:69
(Diff revision 1)
> +  let responseContent = messageNode.querySelector(
> +    "#response-panel .editor-row-container");
> +  ok(responseContent, "Response content is available");
> +
> +  // Select Timings tab and check the content.
> +  EventUtils.sendMouseEvent({ type: "click" }, timingsTab);

could we use `timingTab.click()` directly ?

::: devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_messages_expand.js:72
(Diff revision 1)
> +
> +  // Select Timings tab and check the content.
> +  EventUtils.sendMouseEvent({ type: "click" }, timingsTab);
> +  let timingsContent = messageNode.querySelector(
> +    "#timings-panel .timings-container");
> +  ok(timingsContent, "Timings content is available");

could we test that timingContents.textContent is not empty ?
Attachment #8914695 - Flags: review?(nchevobbe) → review+
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #2)

> > +  ok(responseContent, "Response content is available");
> 
> could we check that responseContent.textContent is not empty ?
So, as I was mentioning at today's meeting. There are cases (I can only repro on Linux) when "responseContent" network update message isn't sent from the backend. This means that the response content is never requested and the Response panel is empty (no Code mirror instance). I've filled a follow up Bug 1406100 and made a comment in the patch.
I didn't remove the related code (it's just commented out) so, we can easily use it to
reproduce the problem.

> devtools/client/webconsole/new-console-output/test/mochitest/
> browser_webconsole_network_messages_expand.js:69
> (Diff revision 1)
> > +  let responseContent = messageNode.querySelector(
> > +    "#response-panel .editor-row-container");
> > +  ok(responseContent, "Response content is available");
> > +
> > +  // Select Timings tab and check the content.
> > +  EventUtils.sendMouseEvent({ type: "click" }, timingsTab);
> 
> could we use `timingTab.click()` directly ?
Done

> devtools/client/webconsole/new-console-output/test/mochitest/
> browser_webconsole_network_messages_expand.js:72
> (Diff revision 1)
> > +
> > +  // Select Timings tab and check the content.
> > +  EventUtils.sendMouseEvent({ type: "click" }, timingsTab);
> > +  let timingsContent = messageNode.querySelector(
> > +    "#timings-panel .timings-container");
> > +  ok(timingsContent, "Timings content is available");
> 
> could we test that timingContents.textContent is not empty ?
Done

Thanks Nicolas!

Honza
Comment on attachment 8914695 [details]
Bug 1404227 - Enhance test for network logs in the Console panel;

https://reviewboard.mozilla.org/r/186002/#review192176

still looking good, thanks honza
Pushed by jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0d8b611c0dd2
Enhance test for network logs in the Console panel; r=nchevobbe
https://hg.mozilla.org/mozilla-central/rev/0d8b611c0dd2
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: