i can see that in SAPUI5 Qunit tests there is option for checkbox for check the code coverage (by checkbox or with an URL parameter ?coverage) But in OPA5 tests in sapui5 there isn't checkbox for code coverage and if i add the URL parameter ?coverage, the test run regular without code coverage. OPA5 test in sapui5 doesn't support code coverage?
Thanks!
Recently Opa5 introduced component based testing, guessing from 1.34 onwards, the code for calling a component based test looks like
prior to the component based approach, we only had the option to run the Opa5 tests via an IFrame, the code for calling a frame based test looks like
A lot of the older examples available use the frame approach which didn't include coverage by default, to get test coverage with the Frame approach you would use something like OpenUi5 Karma with Istanbul.
With component based OpaTests we can now get coverage via the bundled Blanket.js module
see Opa5 with Test Coverage for an example, in this example you will notice the coverage option, the checkbox is checked and there is an additional URL parameter, look down the bottom of the page for the lcov output.
To get the coverage feature in your Qunit runner you'll need to include the following module
hth
JSP
Add the following line of code in your opaTest.qunit.html along with other jQuery.sap.require files -
But make sure you add it after the qunit test files and not before that.