-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
test/OrchardCoreContrib.Testing.UI.Tests/PlaywrightPageHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace OrchardCoreContrib.Testing.UI.Tests; | ||
|
||
internal class PlaywrightPageHelper | ||
{ | ||
public static async Task<IPage> GotoAsync(string pageName) | ||
{ | ||
var playwright = await Playwright.CreateAsync(); | ||
var browser = await playwright.Chromium.LaunchAsync(); | ||
|
||
var page = await browser.NewPageAsync(); | ||
|
||
await page.GotoAsync(GetFullPath(pageName)); | ||
|
||
return new Page(new PlaywrightPageAccessor(page)); | ||
} | ||
|
||
private static string GetFullPath(string pageName) | ||
=> Path.Combine(Environment.CurrentDirectory, "Pages", pageName); | ||
} |