mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-11 15:26:55 +03:00
37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
using System.Threading;
|
|
using NAPS2.App.Tests.Targets;
|
|
using NAPS2.Remoting;
|
|
using NAPS2.Sdk.Tests;
|
|
using Xunit;
|
|
|
|
namespace NAPS2.App.Tests;
|
|
|
|
public class GuiAppTests : ContextualTests
|
|
{
|
|
[GuiTheory]
|
|
[ClassData(typeof(AppTestData))]
|
|
public void CreatesWindow(IAppTestTarget target)
|
|
{
|
|
var process = AppTestHelper.StartGuiProcess(target.Gui, FolderPath);
|
|
try
|
|
{
|
|
if (OperatingSystem.IsWindows())
|
|
{
|
|
AppTestHelper.WaitForVisibleWindow(process);
|
|
Assert.Equal("NAPS2 - Not Another PDF Scanner", process.MainWindowTitle);
|
|
Assert.True(process.CloseMainWindow());
|
|
}
|
|
else
|
|
{
|
|
Thread.Sleep(1000);
|
|
Assert.True(Pipes.SendMessage(process, Pipes.MSG_CLOSE_WINDOW));
|
|
}
|
|
Assert.True(process.WaitForExit(5000));
|
|
AppTestHelper.AssertNoErrorLog(FolderPath);
|
|
}
|
|
finally
|
|
{
|
|
AppTestHelper.Cleanup(process);
|
|
}
|
|
}
|
|
} |