-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathscreenshots_test.go
More file actions
31 lines (26 loc) · 701 Bytes
/
screenshots_test.go
File metadata and controls
31 lines (26 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package biloba_test
import (
"bytes"
"image"
"image/color"
_ "image/png"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("Screenshots", func() {
Describe("it can take screenshots", func() {
BeforeEach(func() {
b.Navigate(fixtureServer + "/screenshots.html")
Eventually(`body`).Should(b.Exist())
})
It("can take screenshots", func() {
b.SetWindowSize(50, 40)
data := b.CaptureScreenshot()
img, _, err := image.Decode(bytes.NewBuffer(data))
Ω(err).ShouldNot(HaveOccurred())
Ω(img.Bounds().Max.X).Should(Equal(50))
Ω(img.Bounds().Max.Y).Should(Equal(40))
Ω(img.At(10, 5)).Should(Equal(color.NRGBA{0, 0, 255, 255}))
})
})
})