Skip to content

Commit

Permalink
Dump screenie on failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanLarsson committed Feb 28, 2018
1 parent 16bc187 commit 579ac27
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
28 changes: 19 additions & 9 deletions Gu.Wpf.Reactive.UiTests/AsyncCommandsWindowTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace Gu.Wpf.Reactive.UiTests
{
using System;
using System.IO;
using Gu.Wpf.UiAutomation;
using NUnit.Framework;

Expand Down Expand Up @@ -52,17 +54,25 @@ public void ClickTwice(string header)
[TestCase("AsyncCancelableParameterCommand")]
public void CancelCommand(string header)
{
using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
try
{
var window = app.MainWindow;
window.FindTextBox("Delay").Text = "200";
var groupBox = window.FindGroupBox(header);
var button = groupBox.FindButton("Run");
var cancelButton = groupBox.FindButton("Cancel");
using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
{
var window = app.MainWindow;
window.FindTextBox("Delay").Text = "200";
var groupBox = window.FindGroupBox(header);
var button = groupBox.FindButton("Run");
var cancelButton = groupBox.FindButton("Cancel");

Assert.AreEqual(false, cancelButton.IsEnabled);
button.Invoke();
Assert.AreEqual(true, cancelButton.IsEnabled);
Assert.AreEqual(false, cancelButton.IsEnabled);
button.Invoke();
Assert.AreEqual(true, cancelButton.IsEnabled);
}
}
catch (TimeoutException e)
{
Capture.ScreenToFile(Path.Combine(Path.GetTempPath(), "AsyncCommandsWindowTests.CancelCommand.png"));
throw;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ before_build:
- ps: dotnet restore -v d

configuration: Release

build:
verbosity: minimal

on_failure:
- ps: Get-ChildItem $env:temp\*.png | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }

0 comments on commit 579ac27

Please sign in to comment.