BackstopJS icon indicating copy to clipboard operation
BackstopJS copied to clipboard

Multiple readySelector in the same time

Open golddragon007 opened this issue 4 years ago • 3 comments

Is there a way to check with readySelector if multiple items on the same page loaded in different locations? (I.e. independent scripts loading boxes, similar to bigpipe).

golddragon007 avatar Feb 12 '21 15:02 golddragon007

I am pretty sure it's valid CSS to separate multiple selectors with a comma. Maybe try that?

garris avatar Feb 12 '21 15:02 garris

Yes, that's true, the only problem that's understood as an 'or' connection instead of 'and'.

golddragon007 avatar Feb 12 '21 15:02 golddragon007

Good point -- there is probably a fancy way to do this but my CSS mojo is really rusty 😞. if no one else can figure it out then it's totally doable in an onReady script. Just chain a few waitFor together -- check puppeteer docs for best syntax.

Alternatively, if you wanted to enhance the readySelector internals to optionally handle an array (sequentially using and) then I would be happy to pull that in too.

Best wishes.

garris avatar Feb 12 '21 16:02 garris