I have code that is at some point doing this:
await page.waitForSelector('.modal-body', {visible: true});
There are multiple .modal-body matches, but this only seems to work if the first match is the one that becomes visible.
I'm assuming the waitForSelector just finds the first match on the selector right away (regardless of whether or not it is visible) and then waits for it to become visible rather than waiting for any element to match both the selector and the option.
I could create logic to count which modal should be opening.. but I'm wondering if there is a way to just wait for any element to match the entire thing (selector + option)?