Question

I'm using Gallio/MbUnit framework for my web testing, and the tests are kicked off from Jenkins. I've installed the Gallio/MbUnit plugin and it's publishing the xml report. I'm trying to find a way to display test log or console messages in the "Test Result" section so the team can easily read failures instead of digging into the "Console Output" for any failed test run.

When I run these Gallio/MbUnit tests from my local machine using Icarus everything is pretty nicely formatted, but not so much with Jenkins. I'd like to keep using it and improve how we display the errors. Suggestions?

For a failed test:

Failed

...MainMenuTests.AcctClaimsItems

Failing for the past 4 builds (Since Failed#128 )
Took 47 sec.
add description
Error Message

Expected value to be false.Actual Value : d:\Jenkins\jobs\...\workspace\WebTesting\Base\Helpers.cs:line 90d:\Jenkins\jobs\...\workspace\WebTesting\TigerEye\Tests\MainMenuTests.cs:line 329true
Stacktrace

   at WebTesting.Base.Helpers.Click(IWebDriver driver, IWebElement element) in 

From the raw console output:

Start time: 4:21 PM
Initializing the runtime and loading plugins.
Verifying test files.
Initializing the test runner.
Running the tests.
[failed] Test WebTesting/MainMenuTests/AcctClaimsItems
Expected value to be false.
Found System.Web Exception after click to url 
.../Accounting/FETReport.aspx

Actual Value : true

   at WebTesting.Base.Click(IWebDriver driver, IWebElement element) in d:\Jenkins\jobs\...\workspace\WebTesting\Base\StaticHelpers.cs:line 90 at WebTesting...\Tests.MainMenuTests.AcctClaimsItems() in d:\Jenkins\jobs\...\workspace\WebTesting\TigerEye\Tests\MainMenuTests.cs:line 329

Code:

if (driver.PageSource.Contains("System.Web - Exception"))
{
    TestLog.Write("Found exception on page {0}", driver.Url);
    TestLog.Write(driver.PageSource.ToString());
    Console.Write("Found exception on page {0}", driver.Url);
    Console.Write(driver.PageSource.ToString());
    Assert.IsFalse(driver.PageSource.Contains("System.Web - Exception"), "Found      System.Web Exception after click to url {0}",driver.Url);
}

No correct solution

OTHER TIPS

There is a general console parsing plugin you can use to add a post build step https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top