browser tests need to be run from command line like pub run test -pdartium
. Is there a way to debug such tests.

- 623,577
- 216
- 2,003
- 1,567
2 Answers
The Dart team is working hard to make tests with the new test package debuggable. Until the related issues are fixed you can use this workaround:
To run browser tests with the new test package, for example from WebStrom, including debugging, just replace the <x-test-dart ...>
tag with a normal Dart script tag pointing to your test file and run it like any Dart browser application from WebStorm.
This also works for Polymer tests. Ensure you run await initPolymer();
or the appropriate initialization necessary for the used Polymer version.
I usually create a copy of the test entry page file where I can keep the replaced script tag.

- 623,577
- 216
- 2,003
- 1,567
pub run test -pdartium --pause-after-load
starts the test only after I click a "play" button on the test page. This gives me time to open up Dev Tools in Dartium and set breakpoints. I can also open up the Observatory and do stuff there.

- 25,267
- 15
- 124
- 150
-
funny - my dartum browser displays the exploding dart image but I never get a 'play' button. – richard Jul 13 '16 at 08:58
-
Which is a known windows bug with the test framework – richard Jul 13 '16 at 09:41