Web テストに Gallio/MbUnit フレームワークを使用しており、テストは Jenkins から開始されます。Gallio/MbUnit プラグインをインストールし、xml レポートを公開しています。「テスト結果」セクションにテストログまたはコンソールメッセージを表示する方法を見つけようとしています。これにより、チームは、失敗したテスト実行の「コンソール出力」を掘り下げる代わりに、失敗を簡単に読み取ることができます。
Icarus を使用してローカル マシンからこれらの Gallio/MbUnit テストを実行すると、すべてがきれいにフォーマットされますが、Jenkins ではそれほどではありません。今後も使い続けて、エラーの表示方法を改善したいと思います。提案?
失敗したテストの場合:
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
生のコンソール出力から:
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
コード:
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);
}