Skip to content

Commit

Permalink
Fix build (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Galad authored Feb 26, 2019
1 parent ff650a3 commit 8904d51
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ToDoList.Specifications/ToDoListSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public void Before()
if (IsLiveUnitTesting)
{
delay = TimeSpan.Zero;
}
}
var actor = new Actor("John")
.WithSeleniumReporting(
new SeleniumReportingConfiguration(
Path.Combine(GetTestDirectory(), "Screenshots"),
GetScreenshotsPath(),
screenshotName)
.AddTextObservers(new DebugObserver())
.WithTakeScreenshotStrategy(new AlwaysTakeScreenshotStrategy()),
.WithTakeScreenshotStrategy(new AlwaysTakeScreenshotStrategy()),
out var seleniumReporter)
.HighlightTargets()
.SlowSelenium(delay)
Expand All @@ -61,6 +61,12 @@ public void Before()
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
actor.Given(Open.TheApplication());
}

private string GetScreenshotsPath()
{
return Path.Combine(GetTestDirectory(), "Screenshots", Context.ScenarioInfo.Title);
}

public static bool IsLiveUnitTesting => AppDomain.CurrentDomain.GetAssemblies()
.Any(a => a.GetName().Name == "Microsoft.CodeAnalysis.LiveUnitTesting.Runtime");

Expand All @@ -79,7 +85,7 @@ public void After()
var seleniumReporter = Context.Get<ISeleniumReporter>();
seleniumReporter.SaveScreenshots();
Debug.WriteLine(seleniumReporter.GetXmlDocument().ToString());
File.WriteAllText(Path.Combine(GetTestDirectory(), "Screenshots", "Report.html"), seleniumReporter.GetHtmlDocument());
File.WriteAllText(Path.Combine(GetScreenshotsPath(), "Report.html"), seleniumReporter.GetHtmlDocument());
}

[Given(@"I have an empty to-do list")]
Expand Down

0 comments on commit 8904d51

Please sign in to comment.