Skip to content

Commit c187f43

Browse files
authored
add missed saving file for ScreentshotFullPage
1 parent 539ae1d commit c187f43

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

page_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ func (s *S) TestScreenshotFullPage() {
410410
res = p.Eval(`({w: innerWidth, h: innerHeight})`)
411411
s.EqualValues(800, res.Get("w").Int())
412412
s.EqualValues(600, res.Get("h").Int())
413+
414+
kit.E(kit.Remove(slash("tmp/screenshots")))
415+
p.ScreenshotFullPage("")
416+
s.Len(kit.Walk(slash("tmp/screenshots/*")).MustList(), 1)
413417
}
414418

415419
func (s *S) TestScreenshotFullPageInit() {

sugar.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ func (p *Page) Screenshot(toFile ...string) []byte {
212212
func (p *Page) ScreenshotFullPage(toFile ...string) []byte {
213213
bin, err := p.ScreenshotE(true, &proto.PageCaptureScreenshot{})
214214
kit.E(err)
215+
kit.E(saveScreenshot(bin, toFile))
215216
return bin
216217
}
217218

0 commit comments

Comments
 (0)