Skip to content

Commit

Permalink
Merge pull request #349 from Microsoft/LogQUnitLogs
Browse files Browse the repository at this point in the history
Add QUnit test execution logs
  • Loading branch information
Kamil Szostak committed Nov 17, 2016
2 parents 3c73136 + 60bcb8b commit a97990d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions JavaScript/JavaScriptSDK.Tests/Selenium/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,33 @@ private void RunTest(RemoteWebDriver driver, string pathToTest, bool runCodeCove
}
}

// Log QUnit execution details
Console.WriteLine("=== QUnit execution details ===");
var tests = driver.FindElementById("qunit-tests").FindElements(OpenQA.Selenium.By.XPath("./li"));

foreach(var test in tests)
{
var testName = test.FindElement(OpenQA.Selenium.By.XPath("./strong/span"));
Console.WriteLine(testName.GetAttribute("innerHTML"));

var steps = test.FindElements(OpenQA.Selenium.By.XPath("./ol/li"));

foreach(var step in steps)
{
Console.Write(step.GetAttribute("class")+ " : ");

var stepDetails = step.FindElements(OpenQA.Selenium.By.XPath("./span"));
foreach(var details in stepDetails)
{
Console.Write(details.GetAttribute("innerHTML")+ " ");
}

Console.WriteLine();
}

Console.WriteLine("===");
}

if (runCodeCoverage)
{
AttachCodeCoverageReport();
Expand Down

0 comments on commit a97990d

Please sign in to comment.