// Wait for WS connection to be established + send messages const onNetworkEvents = waitForNetworkEvents(monitor, 1);
await SpecialPowers.spawn(tab.linkedBrowser, [], async () => {
await content.wrappedJSObject.openConnection(1);
});
await onNetworkEvents;
const requests = document.querySelectorAll(".request-list-item");
is(requests.length, 1, "There should be one request");
// Select the request to open the side panel.
EventUtils.sendMouseEvent({ type: "mousedown" }, requests[0]);
// Wait for all sent/received messages to be displayed in DevTools const wait = waitForDOM(
document, "#messages-view .message-list-table .message-list-item",
2
);
// Click on the "Response" panel
clickOnSidebarTab(document, "response");
await wait;
// Get all messages present in the "Response" panel const frames = document.querySelectorAll( "#messages-view .message-list-table .message-list-item"
);
// Check expected results
is(frames.length, 2, "There should be two frames");
// Sent frame
is(
frames[0].children[0].textContent, " Payload 0", "The correct sent payload should be displayed"
);
is(frames[0].classList.contains("sent"), true, "The payload type is 'Sent'");
// Received frame
is(
frames[1].children[0].textContent, " Payload 0", "The correct received payload should be displayed"
);
is(
frames[1].classList.contains("received"), true, "The payload type is 'Received'"
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.