-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code coverage for JavaScript tests #2505
Comments
I'm not sure if this is a major blocker but I wanted to document this at least. We use the comprehensive-rust/tests/wdio.conf.ts Line 8 in 380dc3c
and we use the browser api to let the local runner test properties in the remote browser. Example: comprehensive-rust/tests/src/basic.test.ts Lines 6 to 7 in 380dc3c
I found documentation for coverage support for wdio but this documents how a
This page also only documents |
I'm not sure how to use the My current setup is looking at the website from the outside via the webdriver protocol with a browser that has this page open. The test is not running in the browser. |
to document some new findings I have made: I have found https://webdriver.io/docs/devtools-service/#capture-code-coverage which can be used to get a coverage report via the devtool protocol but this might be phased out https://webdriver.io/blog/2024/08/15/webdriverio-v9-release/#removal-of-devtools-and-wdiodevtools-service-packages... I nevertheless did a quick and dirty POC and it created a coverage report (formats are html, lcov, json or text). I opened a bug at https://github.com/webdriverio/webdriverio to clarify the documentation as it is not clear to me if a local runner will have this capability (without devtool service) in the future. To try this for yourself you can add this to the [
"devtools",
{
coverageReporter: {
enable: true,
type: "html", // lcov, json, text
logDir: "coverage",
exclude: [/resources/],
},
},
] and also it seems to need an execution of |
Now that #2462 is fixed, a natural next step would be to add support for code coverage on the JavaScript tests. Basically, I would like to know that we exercise most or all of
book.js
in our tests. The same goes for the other JavaScript files we maintain.@Alx-Lai, @michael-kerscher or someone else, please let me know if you're interested in this.
The text was updated successfully, but these errors were encountered: