UntilVisible function

dynamic UntilVisible(
  1. AbstractSelector selector
)

Implementation

UntilVisible(AbstractSelector selector) => (Online browser) async {
      await browser.evaluate('''(selector) => {
        //wait for selector to be visible
        return new Promise((resolve, reject) => {
          const interval = setInterval(() => {
            const element = document.querySelector(selector);
            if (element) {
              clearInterval(interval);
              resolve(true);
            }
          }, 500);
        });
      }''', args: [selector.selector]);

      return true;
    };