4 ms·
This looks great. I also want to shamelessly plug something similar I am working on, Taiko, it uses javascript and comes with a REPL that generates scripts lik
by zabil 7y ago
This looks great.
I also want to shamelessly plug something similar I am working on, Taiko, it uses javascript and comes with a REPL that generates scripts like.
await openBrowser();
await goto("http://todomvc.com/examples/react/#/");
await write("automate with taiko");
await press("Enter");
await click(checkBox(near("automate with taiko")));
The reason we use a javascript is familiarity, IDE support and use of existing node js libraries for testing.
For anyone who's interested
https://github.com/getgauge/taiko https://github.com/getgauge/taiko
- hliyan 7y agoI was very impressed by this! Great minds think alike. Would love more feedback if you have any.
- zabil 7y agoFor sure! Here are a few things we learned after getting feedback from users. * Minimise or better remove all pre-requisites npm install should bring in everything. * Talk directly to the browser using the Chrome DevTools protocol it's not that hard and is now supported by firefox. * Play well with others in a language ecosystem for example if javascript, test runners like gauge, jest, mocha and assertion libraries like chai etc do not build these capabilities. * Run well in headless environments. All the best!
- hliyan 7y agoMuch obliged! Thanks for taking the time to respond.
- kozhevnikov 7y agoFYI to avoid all those awaits and make it chainable you can wrap it in a Proxy. https://github.com/kozhevnikov/proxymise https://github.com/kozhevnikov/proxymise
- DailyHN 7y agoYour sample code looks like a puppeteer script.
- zabil 7y agoClose, but Taiko has a flat API. For reference here's a script in puppeteer const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://example.com'); await page.screenshot({path: 'example.png'}); await browser.close(); and the same thing in Taiko await openBrowser() await goto('https://example.com'); await screenshot({path: 'example.png'}); await closeBrowser();
- Normal_gaussian 7y agoso I can't work on multiple pages in parallel?
- DailyHN 7y agoIt seems that way.
- zabil 7y agoYou can open tabs, incognito windows and switch back and forth
- Normal_gaussian 7y agoIs the tab switching synchronous? If not then I couldn't do it in parallel without inadvertently hitting the wrong tab. If it is then its no better than using a page handle (as a handle would be required)
- deleted 7y ago[deleted]
- mherrmann 7y agoHelium author here. Thank you for mentioning us as an inspiration!
- zabil 7y agoBig fans. Thanks for creating Helium!