Bug 1828790 - Wait for element to be ready. r=devtools-reviewers

See bug 1767679 for a similar bug+fix.

Differential Revision: https://phabricator.services.mozilla.com/D176287
This commit is contained in:
Emilio Cobos Álvarez 2023-05-04 14:18:41 +00:00
parent 2a5ef1f5ec
commit 4ee8b86e8a

View File

@ -13,11 +13,11 @@ add_task(async function() {
const { toolbox, view } = await openRuleView();
info("Getting the filter swatch element");
const swatch = getRuleViewProperty(
view,
"body",
"filter"
).valueSpan.querySelector(".ruleview-filterswatch");
const property = await getRuleViewProperty(view, "body", "filter", {
wait: true,
});
const swatch = property.valueSpan.querySelector(".ruleview-filterswatch");
const filterTooltip = view.tooltips.getTooltip("filterEditor");
// Clicking on a cssfilter swatch sets the current filter value in the tooltip