-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGettingStartedPageTests.cs
More file actions
52 lines (39 loc) · 1.3 KB
/
Copy pathGettingStartedPageTests.cs
File metadata and controls
52 lines (39 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System.Diagnostics;
using FluentAssertions;
namespace Winstrumenta.Package.Tests;
public class GettingStartedPageTests : TestSuiteBase
{
[Test]
public void ShouldShowGettingStartedPageWhenNoArgumentsProvided()
{
var session = GetSession();
session.FindElementByAccessibilityId("Title").Text.Should().Be("Getting started!");
session.FindElementByAccessibilityId("Close").Click();
WaitFor(() => IsAppRunning().Should().BeFalse("App should have been closed by clicking the close button"));
}
[Test]
public void ShouldOpenExplorerWhenClickedOnLinkInPickSection()
{
GetSession().FindElementByAccessibilityId("PickSection").Click();
Sleep(2000);
HasExplorerAsChildProcess().Should().BeTrue();
}
[Test]
public void ShouldOpenExplorerWhenClickedOnLink()
{
GetSession().FindElementByAccessibilityId("PickHyperLink").Click();
Sleep(2000);
HasExplorerAsChildProcess().Should().BeTrue();
}
private bool HasExplorerAsChildProcess()
{
var process = GetAppProcess();
if (process == null)
{
return false;
}
return process
.GetChildProcesses()
.Any(childProcess => childProcess.ProcessName == "explorer.exe");
}
}