0

Is there a way to wait until element is clickable in Testcafe. For example in WebdriverIO we can use this

        const depInput = await $('.--departure');
        await browser.waitUntil(async () => depInput.isClickable());
        await depInput.click();

or use method waitForClickable(). I cannot find the way to do the same in Testcafe.

  • "wdio" is that a nice eatery near you? Please if you use an abbreviation place a full description or reference with it. Also consider adding whatever "testcafe" code you have tried and elaborate your one specific challenge with that. – Mark Schultheiss Dec 13 '22 at 16:42
  • Consider a mutation observer such as the answers here illustrate https://stackoverflow.com/q/5525071/125981 – Mark Schultheiss Dec 13 '22 at 16:45

1 Answers1

0

You can use the Selector.filter method and the timeout option. For example:

await t.click(Selector('.--departure', { timeout: 5000 }).filter(node => !node.disabled));
Alexey Popov
  • 1,033
  • 1
  • 4
  • 12