-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLocalSampleSteps.cs
More file actions
28 lines (23 loc) · 917 Bytes
/
LocalSampleSteps.cs
File metadata and controls
28 lines (23 loc) · 917 Bytes
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 Microsoft.Playwright;
using Reqnroll;
namespace XunitReqnrollPlaywrightBrowserstack.Tests.StepDefinitions;
// Mirrors browserstack/csharp-playwright-browserstack -> SampleLocalTest.cs:
// page.GotoAsync("http://bs-local.com:45454/") + title.Contains("BrowserStack Local")
[Binding]
public class LocalSampleSteps
{
private readonly ScenarioContext _scenario;
private IPage Page => _scenario.Get<IPage>("page");
public LocalSampleSteps(ScenarioContext scenario) => _scenario = scenario;
[Given(@"I open the local sample page on bs-local")]
public async Task OpenLocalSamplePage()
{
await Page.GotoAsync("http://bs-local.com:45454/");
}
[Then(@"the local sample page title contains ""(.*)""")]
public async Task LocalSamplePageTitleContains(string expected)
{
var actual = await Page.TitleAsync();
Assert.Contains(expected, actual);
}
}