Add `hasPopupLabels` helpers for webconsole tests
Categories
(DevTools :: Console, task, P3)
Tracking
(firefox75 fixed)
| Tracking | Status | |
|---|---|---|
| firefox75 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: agam)
References
Details
Attachments
(1 file)
There are a lot of tests where we want to check the content of the autocomplete popup, either by checking some items are in the list, or by checking the full list content.
We should have a helper function that does that for us
So the idea is that we would compare the list labels with an array in argument, and there could be a boolean argument to indicate if we want to check the full content of the list, or just want to check if the elements in the array are in the popup.
| Reporter | ||
Comment 1•1 year ago
|
||
Aggam, would you be interested by this bug?
It's a natural follow up to Bug 1616796
| Assignee | ||
Comment 2•1 year ago
|
||
Sure, thanks for the suggestion. I was anyway looking for something more "advanced" : )
| Assignee | ||
Comment 4•1 year ago
|
||
Hey Nicolas, need some clarifications.
- I am a bit confused about the following part:
"...there could be a boolean argument to indicate if we want to check the full content of the list, or just want to check if the elements in the array are in the popup." .
So the way I understand this, is that the func. accepts 2 arguments, the popup (to be used for the getAutocompletePopupLabels) and a list of hardcoded labels (to be checked against the aforementioned autocomplete labels). I am not sure what you mean "full content of the list" for which the boolean flag should be used. Could you clarify this?
-
Should the function also be placed in
head.js? -
Do you also want me to update any related tests or just submit the patch with the function although unused.
| Reporter | ||
Comment 5•1 year ago
•
|
||
- Sorry I wasn't clear enough
so let's assume we have the autocomplete popup displaying 3 items a, b and c
hasPopupLabels(popup, ["a", "b"])will returntrue, as bothaandbare includedhasPopupLabels(popup, ["a", "b"], true)will return false, as the expected array does not havec
we could derivate 2 functions from that:
hasExactPopupLabels(popup, expected)which would callhasPopupLabels(popup, expected, true)hasPopupLabel(popup, str)which would callhasPopupLabels(popup, [str])
-
yes, this should go into
head.js. Ideally we could put it just below the function we have to retrieve the popup labels -
yes, we should update the tests to use this new function(s) as it will indicate us they're working
let me know if you still have questions :)
| Assignee | ||
Comment 6•1 year ago
|
||
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/703c093cf88c Add `hasPopupLabels` helpers for webconsole tests r=nchevobbe
Comment 8•1 year ago
|
||
| bugherder | ||
Description
•