Skip to content

Commit 90aa4c1

Browse files
committed
Upgrade
1 parent a5bf483 commit 90aa4c1

8 files changed

+17
-17
lines changed

examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.CaptureScreenshot.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public async Task CaptureViewportScreenshot()
2424
{
2525
var context = await driver.AsBiDiContextAsync();
2626

27-
var screenshot = await context.CaptureScreenshotAsync(new() { Clip = new BoxClipRectangle(5, 5, 10, 10) });
27+
var screenshot = await context.CaptureScreenshotAsync(new() { Clip = new ClipRectangle.Box(5, 5, 10, 10) });
2828

2929
Assert.IsNotNull(screenshot);
3030
Assert.IsNotNull(screenshot.Data);
@@ -37,10 +37,10 @@ public async Task CaptureElementScreenshot()
3737

3838
driver.Url = "https://www.selenium.dev/selenium/web/formPage.html";
3939

40-
var element = (await context.LocateNodesAsync(Locator.Css("#checky")))[0];
40+
var element = (await context.LocateNodesAsync(new Locator.Css("#checky")))[0];
4141

4242
//TODO: ShareId is a type, not string
43-
var screenshot = await context.CaptureScreenshotAsync(new() { Clip = new ElementClipRectangle(new(element.SharedId)) });
43+
var screenshot = await context.CaptureScreenshotAsync(new() { Clip = new ClipRectangle.Element(new(element.SharedId)) });
4444

4545
Assert.IsNotNull(screenshot);
4646
Assert.IsNotNull(screenshot.Data);

examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Close.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public async Task CloseTab()
1212
{
1313
var bidi = await driver.AsBiDiAsync();
1414

15-
var context = await bidi.CreateContextAsync(ContextType.Tab);
15+
var context = await bidi.BrowsingContext.CreateAsync(ContextType.Tab);
1616

1717
await context.CloseAsync();
1818
}
@@ -22,7 +22,7 @@ public async Task CloseWindow()
2222
{
2323
var bidi = await driver.AsBiDiAsync();
2424

25-
var context = await bidi.CreateContextAsync(ContextType.Window);
25+
var context = await bidi.BrowsingContext.CreateAsync(ContextType.Window);
2626

2727
await context.CloseAsync();
2828
}

examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Create.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public async Task OpenNewTab()
1212
{
1313
var bidi = await driver.AsBiDiAsync();
1414

15-
var context = await bidi.CreateContextAsync(ContextType.Tab);
15+
var context = await bidi.BrowsingContext.CreateAsync(ContextType.Tab);
1616

1717
Assert.IsNotNull(context);
1818
}
@@ -22,7 +22,7 @@ public async Task OpenNewWindow()
2222
{
2323
var bidi = await driver.AsBiDiAsync();
2424

25-
var context = await bidi.CreateContextAsync(ContextType.Window);
25+
var context = await bidi.BrowsingContext.CreateAsync(ContextType.Window);
2626

2727
Assert.IsNotNull(context);
2828
}
@@ -32,7 +32,7 @@ public async Task OpenTabWithReferenceBrowsingContext()
3232
{
3333
var context1 = await driver.AsBiDiContextAsync();
3434

35-
var context2 = await context1.BiDi.CreateContextAsync(ContextType.Tab, new() { ReferenceContext = context1 });
35+
var context2 = await context1.BiDi.BrowsingContext.CreateAsync(ContextType.Tab, new() { ReferenceContext = context1 });
3636

3737
Assert.IsNotNull(context2);
3838
}
@@ -42,7 +42,7 @@ public async Task OpenWindowWithReferenceBrowsingContext()
4242
{
4343
var context1 = await driver.AsBiDiContextAsync();
4444

45-
var context2 = await context1.BiDi.CreateContextAsync(ContextType.Window, new() { ReferenceContext = context1 });
45+
var context2 = await context1.BiDi.BrowsingContext.CreateAsync(ContextType.Window, new() { ReferenceContext = context1 });
4646

4747
Assert.IsNotNull(context2);
4848
}

examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.BrowsingContextCreated.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public async Task BrowsingContextCreatedEvent()
1515

1616
TaskCompletionSource<BrowsingContextInfo> tcs = new();
1717

18-
await bidi.OnContextCreatedAsync(tcs.SetResult);
18+
await bidi.BrowsingContext.OnContextCreatedAsync(tcs.SetResult);
1919

2020
driver.SwitchTo().NewWindow(OpenQA.Selenium.WindowType.Window);
2121

examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.BrowsingContextDestroyed.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public async Task BrowsingContextDestroyedEvent()
1717

1818
TaskCompletionSource<BrowsingContextInfo> tcs = new();
1919

20-
await bidi.OnContextDestroyedAsync(tcs.SetResult);
20+
await bidi.BrowsingContext.OnContextDestroyedAsync(tcs.SetResult);
2121

2222
await context.CloseAsync();
2323

examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.Event.UserPrompt.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public async Task UserPromptOpenedEvent()
1919
await context.NavigateAsync("https://www.selenium.dev/selenium/web/alerts.html", new() { Wait = ReadinessState.Complete });
2020

2121
//TODO; THhis event can be a part of context
22-
await context.BiDi.OnUserPromptOpenedAsync(tcs.SetResult);
22+
await context.BiDi.BrowsingContext.OnUserPromptOpenedAsync(tcs.SetResult);
2323

2424
driver.FindElement(By.Id("prompt")).Click();
2525

@@ -39,7 +39,7 @@ public async Task UserPromptClosedEvent()
3939
await context.NavigateAsync("https://www.selenium.dev/selenium/web/alerts.html", new() { Wait = ReadinessState.Complete });
4040

4141
//TODO; THhis event can be a part of context
42-
await context.BiDi.OnUserPromptClosedAsync(tcs.SetResult);
42+
await context.BiDi.BrowsingContext.OnUserPromptClosedAsync(tcs.SetResult);
4343

4444
driver.FindElement(By.Id("prompt")).Click();
4545

examples/dotnet/SeleniumDocs/BiDi/BrowsingContext/BrowsingContextTest.GetTree.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public async Task GetAllTopLevelBrowingContexts()
3939
{
4040
var bidi = await driver.AsBiDiAsync();
4141

42-
var window = await bidi.CreateContextAsync(ContextType.Window);
42+
var window = await bidi.BrowsingContext.CreateAsync(ContextType.Window);
4343

44-
var contexts = await bidi.GetTreeAsync();
44+
var contexts = await bidi.BrowsingContext.GetTreeAsync();
4545

4646
Assert.AreEqual(2, contexts.Count);
4747
Assert.AreEqual(contexts[1].Context, window);

examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.7.1" />
1111
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
1212
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
13-
<PackageReference Include="Selenium.Support" Version="4.25.0" />
14-
<PackageReference Include="Selenium.WebDriver" Version="4.25.0" />
13+
<PackageReference Include="Selenium.Support" Version="4.26.1" />
14+
<PackageReference Include="Selenium.WebDriver" Version="4.26.1" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

0 commit comments

Comments
 (0)