naps2/NAPS2.App.Tests/GuiAppTests.cs

36 lines
1022 B
C#
Raw Permalink Normal View History

2022-12-19 02:54:34 +03:00
using NAPS2.App.Tests.Targets;
using NAPS2.Remoting;
using NAPS2.Sdk.Tests;
using Xunit;
namespace NAPS2.App.Tests;
public class GuiAppTests : ContextualTests
{
2022-12-26 00:15:31 +03:00
[GuiTheory]
2022-12-19 02:54:34 +03:00
[ClassData(typeof(AppTestData))]
public void CreatesWindow(IAppTestTarget target)
{
var process = AppTestHelper.StartGuiProcess(target.Gui, FolderPath);
try
{
2024-04-01 20:40:19 +03:00
if (target.IsWindows)
2022-12-19 02:54:34 +03:00
{
AppTestHelper.WaitForVisibleWindow(process);
Assert.Equal("NAPS2 - Not Another PDF Scanner", process.MainWindowTitle);
Assert.True(process.CloseMainWindow());
}
else
{
var helper = ProcessCoordinator.CreateDefault();
2024-04-02 03:32:33 +03:00
Assert.True(helper.CloseWindow(process, 5000));
2022-12-19 02:54:34 +03:00
}
Assert.True(process.WaitForExit(5000));
AppTestHelper.AssertNoErrorLog(FolderPath);
}
finally
{
AppTestHelper.Cleanup(process);
}
}
}