You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TUnit.Playwright/BrowserTest.cs
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,11 @@ public async Task<IBrowserContext> NewContext(BrowserNewContextOptions options)
29
29
[Before(HookType.Test,"",0)]
30
30
publicasyncTaskBrowserSetup()
31
31
{
32
+
if(BrowserType==null)
33
+
{
34
+
thrownewInvalidOperationException($"BrowserType is not initialized. This may indicate that {nameof(PlaywrightTest)}.{nameof(Playwright)} is not initialized or {nameof(PlaywrightTest)}.{nameof(PlaywrightSetup)} did not execute properly.");
thrownewInvalidOperationException($"Browser is not initialized. This may indicate that {nameof(BrowserTest)}.{nameof(BrowserSetup)} did not execute properly.");
Copy file name to clipboardExpand all lines: TUnit.Playwright/PageTest.cs
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,11 @@ public class PageTest : ContextTest
10
10
[Before(HookType.Test,"",0)]
11
11
publicasyncTaskPageSetup()
12
12
{
13
+
if(Context==null)
14
+
{
15
+
thrownewInvalidOperationException($"Browser context is not initialized. This may indicate that {nameof(ContextTest)}.{nameof(ContextSetup)} did not execute properly.");
0 commit comments