devdanke
devdanke

Reputation: 1590

Tools for automated functional testing of a static Dart web app?

Is anyone successfully running automated functional tests against a static Dart web app? If so, what automated tool(s) are you using?

I tried to run automated functional tests using HtmlUnit (a headless browser written in Java). It uses the Mozilla Rhino Javascript engine. But it failed while running tests. Here are two errors I got:

1) java.lang.RuntimeException: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "RQ" from null (http://127.0.0.1/my/hab/settings.dart.js#6369)
2) java.lang.RuntimeException: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function postMessage in object [object Window]. (http://127.0.0.1:3030/my/_dev/hab/dart-web/web/hab_list.dart.js#16070)

The authors of HtmlUnit say their Javascript support is good, but not great. Maybe the Javascript generated by dart2js is more than Rhino can handle at this time.

So I am asking if anyone is successfully using any other tools for automated functional tests.

I've heard of phantomjs (a headless Chrome browser I think). Rather than waste a lot of time investigating testing tools that may not work with dart2js generated code, I'd like to find tools that are known to work.

Thank you

Upvotes: 3

Views: 431

Answers (1)

Danny Tuppeny
Danny Tuppeny

Reputation: 42333

I've had good experiences with PhantomJS, though not tested any dart2js code in it.

If you're worried about compatibility, I would test it directly through a browser (eg. something like Selenium). If it's running through a browser, you're in control of what the browser supports (your error suggests their browser does not support web workers), though it is a bit fiddlier to test up.

Upvotes: 1

Related Questions