Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
internal class CaptureScreenshotCommand(CaptureScreenshotCommandParameters @params)
: Command<CaptureScreenshotCommandParameters>(@params, "browsingContext.captureScreenshot");

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

public record CaptureScreenshotOptions : CommandOptions
{
Expand All @@ -34,12 +34,12 @@ public record CaptureScreenshotOptions : CommandOptions
public ImageFormat? Format { get; set; }

public ClipRectangle? Clip { get; set; }
}

public enum ScreenshotOrigin
{
Viewport,
Document
}
public enum ScreenshotOrigin
{
Viewport,
Document
}

public record struct ImageFormat(string Type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public async Task CanCaptureScreenshotWithParameters()
{
var screenshot = await context.CaptureScreenshotAsync(new()
{
Origin = CaptureScreenshotOptions.ScreenshotOrigin.Document,
Origin = ScreenshotOrigin.Document,
Clip = new BoxClipRectangle(5, 5, 10, 10)
});

Expand All @@ -272,7 +272,7 @@ public async Task CanCaptureScreenshotOfViewport()
{
var screenshot = await context.CaptureScreenshotAsync(new()
{
Origin = CaptureScreenshotOptions.ScreenshotOrigin.Viewport,
Origin = ScreenshotOrigin.Viewport,
Clip = new BoxClipRectangle(5, 5, 10, 10)
});

Expand Down