Skip to content Skip to sidebar Skip to footer

DART - Exception In Unit Testing

I wrote a simple code to demonstrate my problem with the unit-testing. I have prog.html and prog.dart as a program that has to be tested. It works Ok. In the same folder I have tes

Solution 1:

Importing an html file doesn't mean that its content is included in the page with the import tag.

http://www.html5rocks.com/en/tutorials/webcomponents/imports/ (see Using the content).

There are several way you can access the content (for example using a script).

EDIT

I don't think this is the right attempt for web app testing.

  • I suggest either something like https://pub.dartlang.org/packages/webdriver
  • or you could embed your application into a Polymer element which you can use in your test.html file.
  • When you build your application of smaller Polymer elements you can test these smaller parts which may also be reusable. For testing the whole application use something like WebDriver (see first item).

There might be better technologies out there for testing web apps, but I didn't use any of them myself yet.
I use Polymer elements which are easy (easier) to test or Angular which has it's own testing story (also with Dart unit tests, but it is was designed to be testable from the beginning).


Post a Comment for "DART - Exception In Unit Testing"