File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
PuppeteerSharp.Tests/PageTests Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -265,5 +265,26 @@ public void ShouldInferScreenshotTypeFromName()
265265 Assert . Equal ( ScreenshotType . Png , ScreenshotOptions . GetScreenshotTypeFromFile ( "Test.png" ) ) ;
266266 Assert . Null ( ScreenshotOptions . GetScreenshotTypeFromFile ( "Test.exe" ) ) ;
267267 }
268+
269+ [ Fact ]
270+ public async Task ShouldWorkWithQuality ( )
271+ {
272+ using ( var page = await Browser . NewPageAsync ( ) )
273+ {
274+ await page . SetViewportAsync ( new ViewPortOptions
275+ {
276+ Width = 500 ,
277+ Height = 500
278+ } ) ;
279+ await page . GoToAsync ( TestConstants . ServerUrl + "/grid.html" ) ;
280+ var screenshot = await page . ScreenshotDataAsync ( new ScreenshotOptions
281+ {
282+ Type = ScreenshotType . Jpeg ,
283+ FullPage = true ,
284+ Quality = 100
285+ } ) ;
286+ Assert . True ( ScreenshotHelper . PixelMatch ( "screenshot-grid-fullpage.png" , screenshot ) ) ;
287+ }
288+ }
268289 }
269290}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public class ScreenshotOptions
4848 /// </summary>
4949 /// <value>The quality.</value>
5050 [ JsonProperty ( "quality" ) ]
51- public decimal ? Quality { get ; set ; }
51+ public int ? Quality { get ; set ; }
5252
5353 internal static ScreenshotType ? GetScreenshotTypeFromFile ( string file )
5454 {
You can’t perform that action at this time.
0 commit comments