Skip to content

Instantly share code, notes, and snippets.

@raisedadead
Created June 19, 2024 07:15
Show Gist options
  • Save raisedadead/9648055612114d4f6de6e28e7b9f2429 to your computer and use it in GitHub Desktop.
Save raisedadead/9648055612114d4f6de6e28e7b9f2429 to your computer and use it in GitHub Desktop.
// Start chrome with remote debugging port on the terminal like this:
// '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --remote-debugging-port=9222
// Next, run the script with the following command:
// npx taiko main.js --observe
// Code
const {
openBrowser,
link,
click,
toRightOf,
$,
button,
closeBrowser
} = require('taiko');
(async () => {
try {
await openBrowser({ host: 'localhost', port: '9222' });
await openTab('google.com');
// Adjust the number of iterations as needed
for (let i = 0; i < 10; i++) {
await openTab('app.limitless.ai/r');
await click(
link({
class:
'hover:bg-zinc-200/30 group flex cursor-pointer flex-row items-start rounded-lg px-4 py-2'
})
);
await click(
$(
`div.flex > button[aria-haspopup="menu"]`,
toRightOf('Continue Onboarding')
)
);
await click($(`div[role="menuitem"]`));
await click(button('Delete'));
waitFor(2000);
await closeTab('app.limitless.ai/r');
}
} catch (error) {
console.error(error);
} finally {
await closeBrowser();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment