Skip to content

Commit

Permalink
Pretty print modified to show feature and scenario titles - TT
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler-Keith-Thompson committed Apr 23, 2018
1 parent ce1b579 commit 373b693
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions CucumberSwift/Cucumber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,27 @@ import XCTest

public func executeFeatures() {
for feature in features {
BeforeFeature?(feature)
for scenario in feature.scenarios {
BeforeScenario?(scenario)
for step in scenario.steps {
BeforeStep?(step)
currentStep = step
XCTContext.runActivity(named: "\(step.keyword?.rawValue ?? "") \(step.match)") { _ in
step.execute?(step.match.matches(for: step.regex))
if (step.execute != nil && step.result != .failed) {
step.result = .passed
XCTContext.runActivity(named: "Feature: \(feature.title)") { _ in
BeforeFeature?(feature)
for scenario in feature.scenarios {
XCTContext.runActivity(named: "Scenario: \(scenario.title)") { _ in
BeforeScenario?(scenario)
for step in scenario.steps {
BeforeStep?(step)
currentStep = step
XCTContext.runActivity(named: "\(step.keyword?.rawValue ?? "") \(step.match)") { _ in
step.execute?(step.match.matches(for: step.regex))
if (step.execute != nil && step.result != .failed) {
step.result = .passed
}
}
AfterStep?(step)
}
AfterScenario?(scenario)
}
AfterStep?(step)
}
AfterScenario?(scenario)
AfterFeature?(feature)
}
AfterFeature?(feature)
}
DispatchQueue.main.async {
if let documentDirectory = try? FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor:nil, create:false),
Expand Down

0 comments on commit 373b693

Please sign in to comment.