Closed Hsilgos closed 1 year ago
Hi again. May I ask if there is a reason why all steps are listed as plain list in test results? I tried the following:
public final class CucumberTest: XCTestCase { override public class var defaultTestSuite: XCTestSuite { .... // Instead of this: // allGeneratedTests.forEach { suite.addTest($0) } // Call this: generateAlltests(suite) return suite } static func generateAlltests(_ rootSuite: XCTestSuite) { for feature in Cucumber.shared.features.taggedElements(with: Cucumber.shared.environment, askImplementor: false) { let className = feature.title.toClassString() + readFeatureScenarioDelimiter() for scenario in feature.scenarios.taggedElements(with: Cucumber.shared.environment, askImplementor: true) { let childSuite = XCTestSuite(name: scenario.title.toClassString()) var tests = [XCTestCase]() createTestCaseFor(className: className, scenario: scenario, tests: &tests) tests.forEach{ childSuite.addTest($0) } rootSuite.addTest(childSuite) } } }
And my test reports become much nicer, see screenshot. Does it make sense to continue to improve in this direction?
That looks great! Feel free to submit a PR.
This is available in CucumberSwift v3.3.26
Hi again. May I ask if there is a reason why all steps are listed as plain list in test results? I tried the following:
And my test reports become much nicer, see screenshot. Does it make sense to continue to improve in this direction?