Add suite and test field of skipped test to xml report#14422
Add suite and test field of skipped test to xml report#14422christian-bromann merged 2 commits intowebdriverio:mainfrom
Conversation
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/appium-service
@wdio/browser-runner
@wdio/cli
@wdio/concise-reporter
@wdio/browserstack-service
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/junit-reporter
@wdio/lighthouse-service
@wdio/local-runner
@wdio/logger
@wdio/mocha-framework
@wdio/protocols
@wdio/repl
@wdio/reporter
@wdio/runner
@wdio/sauce-service
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/testingbot-service
@wdio/types
@wdio/utils
@wdio/webdriver-mock-service
webdriver
webdriverio
commit: |
christian-bromann
left a comment
There was a problem hiding this comment.
Let's document this change.
| if (suiteKeys.length === 0) { | ||
| const error = this.runnerStat?.error ?? 'No tests found' | ||
| return builder.testCase().failure(error) | ||
| if (!isCucumberFrameworkRunner || (isCucumberFrameworkRunner && type === 'feature')) { |
There was a problem hiding this comment.
Can you elaborate why we need this if statement? Maybe to help have contributors understand what this means, a comment may make sense here.
There was a problem hiding this comment.
Yeah, that is to make cucumber and mocha result look the same for empty suites. Otherwise, _buildOrderedReport will be ran twice for cucumber (for feature and scenario) and the xml will look like this:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2" failures="2" errors="0" skipped="0">
<testsuite tests="1" failures="1" errors="0" skipped="0">
<testcase classname="" name="">
<failure message="No tests found"/>
</testcase>
</testsuite>
<testsuite tests="1" failures="1" errors="0" skipped="0">
<testcase classname="" name="">
<failure message="No tests found"/>
</testcase>
</testsuite>
</testsuites>which is ok too, if that's the look you want.
There was a problem hiding this comment.
No, this makes total sense. Let's just add a comment help the next person understand this context because it is almost impossible to do so without this. Just add a comment with the appropriate context information.
Sure, how would you like me to document this? |
7f76c64 to
64bfe19
Compare
|
@christian-bromann better? |
|
Hey ccharnkij 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
Proposed changes
My attempt at addressing #14411 and #14374 while keeping #14223.
This is how it will look:
Tested with Jenkins Junit Plugin 1322.v1556dc1c59a_f



Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers