Through the guide, I thought it'll produce the report only for those tests which has instrument config but instead of that it runs whole tests (unit tests + ui/integration tests). So;
- How can i state a specific test file or test group?
- I couldn't wait for terminal-based test runner because it started 2 hours ago and still keep going.. So how I'll achieve to code-coverage report's HTML? End of terminal-test?
Basically, when using `pageUrl` code coverage is not supported.
When you run the launcher with --coverage-report-format option, it still runs the full suite (possibly filtered with --filter and --include options) and then generate the coverage report.
Also note, when using "pageUrl" the "preload" config is not inherited from top-level descriptors.
so then what is the alternative for pageUrl ? So far I know i can not use hostPageUrl as well because you mentioned that it has been deprecated.
and I've used preload to run code-coverage only for Globals.js. What about if I'll not use preload config and using instrument: true just under test-file itself? Still keep doing coverage?
Last edited by nuridesengin on Thu Dec 28, 2017 12:36 pm, edited 1 time in total.
First of all, the "preload" descriptor is not used by the "010_globals-typeof.t.js" test, since it uses `pageUrl` and that stops the inheritance (which is usually what you want).
You need to use the 2nd option, mentioned in the link, "Or, when using Siesta.Harness.pageUrl option:" The `eval(parent.harness.getLoaderInstrumentationHook())` has to be called right before the application begins loading of required classes.
first of all I've stated second option on both app's index.html & siesta's index.html. Copy pasted those lines;
<script type="text/javascript">
// will be executed when running in testing environment only
// the `harness` here should match the name of the main scope variable for harness
parent.harness && eval(parent.harness.getLoaderInstrumentationHook())
</script>
as well tried several options for preload config but non of them produced coverage report;
1. Disabling preload on harness.configure and state it on harness.start with unit-test file (010_globals-typeof.t.js). As well disabled pageUrl and re-able back but all behaves same.
2. and then disabled preload on harness.start and re-able on harness.configure with 010_globals..
also disabled pageUrl and re-able back but still same.
Well, need to understand how it works, mechanically changing the configs won't do it. Note, that for `pageUrl` case, the coverage is only supported for classes, loaded through "Ext.require" mechanism (possibly as dependencies for other classes). The
`eval(parent.harness.getLoaderInstrumentationHook())` has to be called before application has started loading. For that:
- App should be built using "development" Sencha Cmd mode (possibly "testing" build works too).
- The <script> tag should be placed at the right place in app's "index.html"
If you can prepare a standalone reproducible test case, I can take a look. Make sure it is actually standalone - that is, if you unpack it to different location it still works.