Closed Bug 1617540 Opened 4 years ago Closed 4 years ago

Add `hasPopupLabels` helpers for webconsole tests

Categories

(DevTools :: Console, task, P3)

task

Tracking

(firefox75 fixed)

RESOLVED FIXED
Firefox 75
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.

Aggam, would you be interested by this bug?
It's a natural follow up to Bug 1616796

Flags: needinfo?(agg_gam)

Sure, thanks for the suggestion. I was anyway looking for something more "advanced" : )

Flags: needinfo?(agg_gam)

Great :)

Assignee: nobody → agg_gam

Hey Nicolas, need some clarifications.

  1. 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?

  1. Should the function also be placed in head.js?

  2. Do you also want me to update any related tests or just submit the patch with the function although unused.

Flags: needinfo?(nchevobbe)
  1. 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 return true, as both a and b are included
  • hasPopupLabels(popup, ["a", "b"], true) will return false, as the expected array does not have c

we could derivate 2 functions from that:

  • hasExactPopupLabels(popup, expected) which would call hasPopupLabels(popup, expected, true)
  • hasPopupLabel(popup, str) which would call hasPopupLabels(popup, [str])
  1. yes, this should go into head.js. Ideally we could put it just below the function we have to retrieve the popup labels

  2. 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 :)

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/703c093cf88c
Add `hasPopupLabels` helpers for webconsole tests r=nchevobbe
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: