-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUITestOfT.cs
More file actions
28 lines (25 loc) · 1.2 KB
/
UITestOfT.cs
File metadata and controls
28 lines (25 loc) · 1.2 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
using OrchardCoreContrib.Testing.UI.Infrastructure;
using OrchardCoreContrib.Testing.UI.PageObjects;
namespace OrchardCoreContrib.Testing.UI;
/// <summary>
/// Represents a UI testing class that extends <see cref="UITestBase{TStartup}"/>.
/// </summary>
/// <param name="browserType">The browser type that will be used during the test. Defaults to <see cref="BrowserType.Edge"/>.</param>
/// <param name="headless">Whether the browser runs in headless mode or not. Defaults to <c>true</c>.</param>
/// <param name="delay">The amount of time to wait between execute two actions. Defaults to <c>0</c>.</param>
/// <typeparam name="TStartup">The startup class type that will be used as entry point.</typeparam>
public class UITest<TStartup>(BrowserType browserType = BrowserType.Edge, bool headless = true, int delay = 0) :
UITestBase<TStartup>(new WebApplicationFactoryFixture<TStartup>(), new UITestOptions
{
BrowserType = browserType,
Headless = headless,
Delay = delay
}), IUITest where TStartup : class
{
/// <inheritdoc/>
public override async Task InitializeAsync()
{
await base.InitializeAsync();
await PageFactory.InitializeAsync(Browser, BaseUrl);
}
}