Derived from bug 1764682 bug 1764682 is caused by [`findMessage` testing function](https://searchfox.org/mozilla-central/rev/d34f9713ae128a3138c2b70d8041a535f1049d19/devtools/client/webconsole/test/browser/head.js#335) returns console input, while the code should wait for console API output. There seems to be similar situation in other tests, for the case that the test executes code from console and wait for output: https://searchfox.org/mozilla-central/rev/d34f9713ae128a3138c2b70d8041a535f1049d19/devtools/client/webconsole/test/browser/browser_console_chrome_context_message.js#21-30 ``` const expectedMessages = [ `Cu.reportError`, // bug 1561930 ]; ... execute(hud, `Cu.reportError("Cu.reportError");`); // bug 1561930 ... await waitFor(() => expectedMessages.every(expectedMessage => findMessage(hud, expectedMessage)) ``` Those tests should pass special selector to the 3rd parameter of `findMessage`. (such as `".console-api"` for `console.log`, not sure for `Cu.reportError`, maybe just `:not(.command)` ?) Or maybe we should make the default behavior ignore the console input (`".message:not(.command)"`)?
Bug 1764717 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Derived from bug 1764682 bug 1764682 is caused by [`findMessage` testing function](https://searchfox.org/mozilla-central/rev/d34f9713ae128a3138c2b70d8041a535f1049d19/devtools/client/webconsole/test/browser/head.js#335) returns console input, while the code should wait for console API output. There seems to be similar situation in other tests, for the case that the test executes code from console and wait for output: https://searchfox.org/mozilla-central/rev/d34f9713ae128a3138c2b70d8041a535f1049d19/devtools/client/webconsole/test/browser/browser_console_chrome_context_message.js#21-30 ``` const expectedMessages = [ `Cu.reportError`, // bug 1561930 ]; ... execute(hud, `Cu.reportError("Cu.reportError");`); // bug 1561930 ... await waitFor(() => expectedMessages.every(expectedMessage => findMessage(hud, expectedMessage)) ``` Those tests should pass special selector to the 3rd parameter of `findMessage`. (such as `".console-api"` for `console.log`, not sure for `Cu.reportError`, maybe just `:not(.command)` ?) Or maybe we should make the default behavior ignore the console input (`".message:not(.command)"`)?