Skip to content

Instantly share code, notes, and snippets.

@benjiwheeler
Last active December 19, 2018 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjiwheeler/6e67757ead69cbce9aa2dc3d2e327b59 to your computer and use it in GitHub Desktop.
Save benjiwheeler/6e67757ead69cbce9aa2dc3d2e327b59 to your computer and use it in GitHub Desktop.
selenium js 3.6 attempt to wait until element is clickable
const costumesTabElement = await findByText('Costumes');
await driver.wait(() => {
return costumesTabElement.isDisplayed().then(displayed => {
console.log('got here A');
if (!displayed) return false;
console.log('got here B');
// costumesTabElement.click();
return costumesTabElement.isEnabled();
});
});
console.log('got here C');
await clickText('Costumes');
await new Promise(resolve => setTimeout(resolve, 3000));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment