ui5-community / wdi5

official UI5 end-to-end test framework for UI5 web-apps. wdi5 = Webdriver.IO + UI5 Test API
https://ui5-community.github.io/wdi5/
Apache License 2.0
102 stars 43 forks source link

How to get code coverage for UI5 apps? #590

Closed navisarv closed 6 months ago

navisarv commented 8 months ago

Hi Team, I would like to get coverage report for UI5 app and I am looking for similar to https://webdriver.io/docs/component-testing/coverage/

your help is much appreciated!!

vobu commented 8 months ago

AFAIK, wdio (and thus wdi5) supports this out of the box: https://webdriver.io/docs/runner/#coverage Disclaimer: haven't used it personally

PavlinaCherkezova commented 8 months ago

I am looking as well for a way to get a coverage report of the UI5 e2e tests. I have tried to enable the coverage as described in the docs, but I get the following error: image

This is based on the default e2e tests after generating a UI5 typescript app with generator-ui5-ts-app. I have added the following settings to the wdio.conf.ts: runner: [ "browser", { coverage: { enabled: true, extension: "ts", reporter: ["text", "html"], }, }, ],

Is this a problem with the configuration or with the wdio and ui5?
Thanks in advance!

vobu commented 8 months ago

hi pavlina, you're using the wdio "browser" runner, which executes the framework within the browser and which is not available for wdi5/UI5. you need the "local" runner: https://webdriver.io/docs/runner#setup

Moh-Adel-Aly commented 8 months ago

Hi Vobu,

I had the same issue as Pavlina, I also tried using the local runner but code coverage is not supported for the local runners. the tests run fine but there nothing happens and no coverage report is being shown or files being created.

As for the browser runner, it always starts localhost with a random port. I tried overwriting this in different methods but nothing worked. as you have clearly said before WDI5 does not support it.

From my understanding the WDIO framework uses Istanbul for code coverage, is there any workarounds for this?

Siolto commented 8 months ago

Hi,

coverage reports do not work for e2e tests and it also does not make any sense. If you want to have coverage you need to use Component Testing which is simply not possible with wdi5.

Code Coverage in UI5 applications is currently possible on the unit and integration test layer.

Regards Simon

github-actions[bot] commented 7 months ago

hey 👋 - silence for 30 days 🤐 ... anybody? 😀

github-actions[bot] commented 6 months ago

closed 📴 because silencio 🤫 since an additional 14 days after staleness 📠