Skip to content

Commit

Permalink
add missed saving file for ScreentshotFullPage
Browse files Browse the repository at this point in the history
  • Loading branch information
yasarluo authored Jul 16, 2020
1 parent 539ae1d commit c187f43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ func (s *S) TestScreenshotFullPage() {
res = p.Eval(`({w: innerWidth, h: innerHeight})`)
s.EqualValues(800, res.Get("w").Int())
s.EqualValues(600, res.Get("h").Int())

kit.E(kit.Remove(slash("tmp/screenshots")))
p.ScreenshotFullPage("")
s.Len(kit.Walk(slash("tmp/screenshots/*")).MustList(), 1)
}

func (s *S) TestScreenshotFullPageInit() {
Expand Down
1 change: 1 addition & 0 deletions sugar.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ func (p *Page) Screenshot(toFile ...string) []byte {
func (p *Page) ScreenshotFullPage(toFile ...string) []byte {
bin, err := p.ScreenshotE(true, &proto.PageCaptureScreenshot{})
kit.E(err)
kit.E(saveScreenshot(bin, toFile))
return bin
}

Expand Down

0 comments on commit c187f43

Please sign in to comment.