Live data from Hacker News

Show HN: Kasaya – A scripting language and runtime for browser automation

github.com

31–40 of 109 posts

Re: Show HN: Kasaya – A scripting language and runtime for browser automation

#32
post #14

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 exist…

Your sample code looks like a puppeteer script.

Re: Show HN: Kasaya – A scripting language and runtime for browser automation

#33

Would be great if this "transpiled" into a more robust and popularly supported formalism so that the functionality could be refined over time. I could see implementing this script as being a requirement for a new feature delivered by engineering, and then having test engineering use that functionality as a foundation for more thorough qualification. I worry that this approach by itself will fall into the same issues…

> Would be great if this "transpiled" into a more robust and popularly supported formalism so that the functionality could be refined over time.

Great idea. Would love to see something like that. For now I'll have to continue to roll my own generators/templates.

Re: Show HN: Kasaya – A scripting language and runtime for browser automation

#34
post #23
post #14

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 exist…

I was very impressed by this! Great minds think alike. Would love more feedback if you have any.

For 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!

Re: Show HN: Kasaya – A scripting language and runtime for browser automation

#35
post #7

We can do this with Canopy in F# (repl/interactive style too!): //go to url url "http://lefthandedgoat.github.io/canopy/testpages/" //assert that the element with an id of 'welcome' has //the text 'Welcome' "#welcome" == "Welcome" //assert that the element with an id of 'firstName' has the value 'John' "#firstName" == "John" //change the value of element with //an id of 'firstName' to 'Something Else' "#firstName" ht…

The idea of this library is exactly to not use HTML ids (or css paths etc), but use instructions you could give to an human browsing the web (enter the page, press tab, type this..)

Re: Show HN: Kasaya – A scripting language and runtime for browser automation

#36
post #29

All those kind of projects share the same flaw: it uses a DSL instead of an existing language, so tooling/documentation/testing/support/modules are going to be very weak, and 100% depending of the creator for the first years, in a domain that is already a niche. It could be a library with good API instead. Or even a special env setup for an existing language with injected built-in and automatic imports. Now you could…

I actually kind of really like this DSL, I think it is going to be easier for my QA team to use this, than asking them to use javascript.

I know right. It looks so nice. I want to pet it.

But it's a trap.

Re: Show HN: Kasaya – A scripting language and runtime for browser automation

#37
post #22

Does it use Selenium under the hood?

Yes it does...

Note that some sites block Selenium, since browsers report the use of WebDriver, and Selenium injects known predictable Javascript. Does Kasaya do anything to mitigate this?

Re: Show HN: Kasaya – A scripting language and runtime for browser automation

#38
post #29

All those kind of projects share the same flaw: it uses a DSL instead of an existing language, so tooling/documentation/testing/support/modules are going to be very weak, and 100% depending of the creator for the first years, in a domain that is already a niche. It could be a library with good API instead. Or even a special env setup for an existing language with injected built-in and automatic imports. Now you could…

I actually kind of really like this DSL, I think it is going to be easier for my QA team to use this, than asking them to use javascript.

Seriously, how is this DSL better? With JavaScript you get method completion and debugging. Are parentheses really so terrible?

You can setup a DSL in scala.js and you can get the best of both worlds (though, parentheses are fine for me so I would just use one of the many fine existing JS libraries).

Re: Show HN: Kasaya – A scripting language and runtime for browser automation

#39
post #34
post #23

Earlier quoted context omitted.

I was very impressed by this! Great minds think alike. Would love more feedback if you have any.

For 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 l…

Much obliged! Thanks for taking the time to respond.

Re: Show HN: Kasaya – A scripting language and runtime for browser automation

#40
post #22

Earlier quoted context omitted.

Yes it does...

Note that some sites block Selenium, since browsers report the use of WebDriver, and Selenium injects known predictable Javascript. Does Kasaya do anything to mitigate this?

Not yet, but someone suggested Chrome DevTools protocol. This is still in the very early stages, so we're looking into these things.
Post reply on HN