2021-12-24 22:10:25 +03:00
|
|
|
using Microsoft.Maui.Automation;
|
2021-12-29 22:23:04 +03:00
|
|
|
using System.Collections.Generic;
|
2021-12-24 22:10:25 +03:00
|
|
|
using System.Net;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace RemoteAutomationTests
|
|
|
|
{
|
|
|
|
public class UnitTest1
|
|
|
|
{
|
|
|
|
[Fact]
|
2021-12-28 23:28:02 +03:00
|
|
|
public async Task ListWindowsTest()
|
2021-12-24 22:10:25 +03:00
|
|
|
{
|
|
|
|
// Build a mock app
|
|
|
|
var app = new MockApplication()
|
2021-12-28 01:48:24 +03:00
|
|
|
.WithWindow("window1", "Window", "Window Title")
|
|
|
|
.WithView("view1");
|
2022-09-03 04:12:37 +03:00
|
|
|
|
|
|
|
var windows = new List<Element>();
|
2022-09-09 00:10:33 +03:00
|
|
|
var elems = await app.GetElements();
|
2021-12-24 22:10:25 +03:00
|
|
|
|
|
|
|
// Query the remote host
|
2022-09-03 04:12:37 +03:00
|
|
|
foreach (var window in elems)
|
2021-12-29 22:23:04 +03:00
|
|
|
{
|
|
|
|
windows.Add(window);
|
|
|
|
}
|
2021-12-24 22:10:25 +03:00
|
|
|
|
|
|
|
Assert.NotEmpty(windows);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|