Skip to content

Commit ca9de17

Browse files
authored
[dotnet] [bidi] Decouple ScreenshotOrigin in BrowsingContext module (#15488)
1 parent 2be9609 commit ca9de17

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CaptureScreenshotCommand.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
2525
internal class CaptureScreenshotCommand(CaptureScreenshotCommandParameters @params)
2626
: Command<CaptureScreenshotCommandParameters>(@params, "browsingContext.captureScreenshot");
2727

28-
internal record CaptureScreenshotCommandParameters(BrowsingContext Context, CaptureScreenshotOptions.ScreenshotOrigin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;
28+
internal record CaptureScreenshotCommandParameters(BrowsingContext Context, ScreenshotOrigin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;
2929

3030
public record CaptureScreenshotOptions : CommandOptions
3131
{
@@ -34,12 +34,12 @@ public record CaptureScreenshotOptions : CommandOptions
3434
public ImageFormat? Format { get; set; }
3535

3636
public ClipRectangle? Clip { get; set; }
37+
}
3738

38-
public enum ScreenshotOrigin
39-
{
40-
Viewport,
41-
Document
42-
}
39+
public enum ScreenshotOrigin
40+
{
41+
Viewport,
42+
Document
4343
}
4444

4545
public record struct ImageFormat(string Type)

dotnet/test/common/BiDi/BrowsingContext/BrowsingContextTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public async Task CanCaptureScreenshotWithParameters()
259259
{
260260
var screenshot = await context.CaptureScreenshotAsync(new()
261261
{
262-
Origin = CaptureScreenshotOptions.ScreenshotOrigin.Document,
262+
Origin = ScreenshotOrigin.Document,
263263
Clip = new BoxClipRectangle(5, 5, 10, 10)
264264
});
265265

@@ -272,7 +272,7 @@ public async Task CanCaptureScreenshotOfViewport()
272272
{
273273
var screenshot = await context.CaptureScreenshotAsync(new()
274274
{
275-
Origin = CaptureScreenshotOptions.ScreenshotOrigin.Viewport,
275+
Origin = ScreenshotOrigin.Viewport,
276276
Clip = new BoxClipRectangle(5, 5, 10, 10)
277277
});
278278

0 commit comments

Comments
 (0)