Skip to content

Commit 74fde27

Browse files
committed
Screenshot origin
1 parent 3efcdd7 commit 74fde27

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ namespace OpenQA.Selenium.BiDi.Communication.Json;
119119

120120
[JsonSerializable(typeof(Modules.BrowsingContext.UserPromptOpenedEventArgs))]
121121
[JsonSerializable(typeof(Modules.BrowsingContext.UserPromptClosedEventArgs))]
122-
[JsonSerializable(typeof(Modules.BrowsingContext.Origin), TypeInfoPropertyName = "BrowsingContext_Origin")]
123122

124123
[JsonSerializable(typeof(Modules.Network.BytesValue.String), TypeInfoPropertyName = "Network_BytesValue_String")]
125124
[JsonSerializable(typeof(Modules.Network.UrlPattern.String), TypeInfoPropertyName = "Network_UrlPattern_String")]

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ 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, Origin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;
28+
internal record CaptureScreenshotCommandParameters(BrowsingContext Context, CaptureScreenshotOptions.ScreenshotOrigin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;
2929

3030
public record CaptureScreenshotOptions : CommandOptions
3131
{
32-
public Origin? Origin { get; set; }
32+
public ScreenshotOrigin? Origin { get; set; }
3333

3434
public ImageFormat? Format { get; set; }
3535

3636
public ClipRectangle? Clip { get; set; }
37-
}
3837

39-
public enum Origin
40-
{
41-
Viewport,
42-
Document
38+
public enum ScreenshotOrigin
39+
{
40+
Viewport,
41+
Document
42+
}
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 = Origin.Document,
262+
Origin = CaptureScreenshotOptions.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 = Origin.Viewport,
275+
Origin = CaptureScreenshotOptions.ScreenshotOrigin.Viewport,
276276
Clip = new BoxClipRectangle(5, 5, 10, 10)
277277
});
278278

0 commit comments

Comments
 (0)