Skip to content

Instantly share code, notes, and snippets.

@AndersDJohnson
Created February 13, 2021 17:17
Show Gist options
  • Save AndersDJohnson/f015e258d311aed903c0f8cd7bcb46e7 to your computer and use it in GitHub Desktop.
Save AndersDJohnson/f015e258d311aed903c0f8cd7bcb46e7 to your computer and use it in GitHub Desktop.
{
const $ = document.querySelector.bind(document)
do {
$('[data-qa="remove-favorite"]').click()
await new Promise(r => setTimeout(r, 1000))
$('[data-qa="yes-remove-btn"]').click()
await new Promise(r => setTimeout(r, 1000))
next = $('[data-qa="remove-favorite"]')
} while (next)
}
@AndersDJohnson
Copy link
Author

Self-code review: Could make this cleaner someday if web gets the new Node.js v16 Timers Promises API! 🙏 😍 await setTimeout(1000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment