Docs · API reference · Motus.Testing.MSTest

MotusTestBase Class#

Base class for MSTest browser tests. Shares a single browser across all tests in the assembly and creates an isolated context per test. Compatible with [Parallelize].

public abstract class MotusTestBase

Inheritance System.Object → MotusTestBase

Properties#

TestContext Property#

MSTest test context, used to detect test outcome for failure tracing.

public Microsoft.VisualStudio.TestTools.UnitTesting.TestContext TestContext { get; set; }

Property Value#

Microsoft.VisualStudio.TestTools.UnitTesting.TestContext

Methods#

CloseBrowserAsync() Method#

Disposes the shared browser. Apply [AssemblyCleanup] in your test assembly to call this method.

public static System.Threading.Tasks.Task CloseBrowserAsync();

Returns#

System.Threading.Tasks.Task

LaunchBrowserAsync(LaunchOptions) Method#

Launches the shared browser. Apply [AssemblyInitialize] in your test assembly to call this method.

public static System.Threading.Tasks.Task LaunchBrowserAsync(Motus.Abstractions.LaunchOptions? options=null);

Parameters#

options LaunchOptions

Returns#

System.Threading.Tasks.Task