Skip to content

Commit

Permalink
Update to Chrome 83 (#4)
Browse files Browse the repository at this point in the history
* Ease timeout

* Update Chrome version/arch

* go fmt
  • Loading branch information
Takaaki Shirai authored May 26, 2020
1 parent 8a6aff4 commit 16cc1e9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
12 changes: 5 additions & 7 deletions browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,14 @@ func (b *Browser) ExpectTransitTo(rawurl string) *Browser {
return b
}



func (b *Browser) SetWindowSize(width,height int) {
b.session.GetCurrentWindowHandle().SetSize(webdriver.Size{width,height})
func (b *Browser) SetWindowSize(width, height int) {
b.session.GetCurrentWindowHandle().SetSize(webdriver.Size{width, height})
}

func (b *Browser) GetWindowSize()(width,height int, err error) {
size,err := b.session.GetCurrentWindowHandle().GetSize()
func (b *Browser) GetWindowSize() (width, height int, err error) {
size, err := b.session.GetCurrentWindowHandle().GetSize()
if err != nil {
return
}
return size.Width,size.Height, nil
return size.Width, size.Height, nil
}
4 changes: 2 additions & 2 deletions chrome/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func chromeVersion() (version string) {
}
}
if err != nil {
return "74"
return "83"
}
return parseChromeVersion(line)
}
Expand Down Expand Up @@ -82,7 +82,7 @@ func targetArch() (target string, err error) {

switch runtime.GOOS {
case "darwin":
return "mac32", nil
return "mac64", nil
case "linux":
return "linux" + arch, nil
case "windows":
Expand Down
6 changes: 3 additions & 3 deletions chrome/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ func TestParseChromeVersion(t *testing.T) {
line string
version string
}{
{`Chromium 73.0.3683.75 Built on Ubuntu , running on Ubuntu 16.04`, "73"},
{`Chromium 72.0.3626.122 built on Debian 9.8, running on Debian 9.4`, "72"},
{`Google Chrome 73.0.3683.103`, "73"},
{`Chromium 83.0.4103.39 Built on Ubuntu , running on Ubuntu 16.04`, "83"},
{`Chromium 81.0.4044.92 built on Debian 9.8, running on Debian 9.4`, "81"},
{`Google Chrome 83.0.4103.39`, "83"},
}

for n, tt := range tests {
Expand Down
2 changes: 1 addition & 1 deletion example/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestPlayground(t *testing.T) {

b := ts.OpenBrowser()
b.SetWindowSize(1600,1200)
b.SetPageLoadTimeout(2 * time.Second)
b.SetPageLoadTimeout(4 * time.Second)

b.VisitTo("https://play.golang.org/")
b.WaitFor("id:code").Element().Clear().Input(code)
Expand Down

0 comments on commit 16cc1e9

Please sign in to comment.