Skip to content

Commit a0bbf04

Browse files
authored
chore: roll to Playwright v1.35.1 (#354)
* chore: roll to Playwright v1.35.1 * fix: rpc protocol update * feat: Locators support chain calls BREAKING CHANGE: Make Locator easier to chain calls, e.g: `_, err := page.Locator("body").Locator("div").And("p").TextContent()`
1 parent 84f17d4 commit a0bbf04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2447
-1411
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
[![PkgGoDev](https://pkg.go.dev/badge/github.com/playwright-community/playwright-go)](https://pkg.go.dev/github.com/playwright-community/playwright-go)
66
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](http://opensource.org/licenses/MIT)
77
[![Go Report Card](https://goreportcard.com/badge/github.com/playwright-community/playwright-go)](https://goreportcard.com/report/github.com/playwright-community/playwright-go) ![Build Status](https://github.com/playwright-community/playwright-go/workflows/Go/badge.svg)
8-
[![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://aka.ms/playwright-slack) [![Coverage Status](https://coveralls.io/repos/github/playwright-community/playwright-go/badge.svg?branch=main)](https://coveralls.io/github/playwright-community/playwright-go?branch=main) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-110.0.5481.38-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-108.0.2-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-16.4-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop -->
8+
[![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://aka.ms/playwright-slack) [![Coverage Status](https://coveralls.io/repos/github/playwright-community/playwright-go/badge.svg?branch=main)](https://coveralls.io/github/playwright-community/playwright-go?branch=main) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-115.0.5790.24-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-113.0-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-16.4-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop -->
99

1010
[API reference](https://playwright.dev/docs/api/class-playwright) | [Example recipes](https://github.com/playwright-community/playwright-go/tree/main/examples)
1111

1212
Playwright is a Go library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.
1313

1414
| | Linux | macOS | Windows |
1515
| :--- | :---: | :---: | :---: |
16-
| Chromium <!-- GEN:chromium-version -->110.0.5481.38<!-- GEN:stop --> ||||
16+
| Chromium <!-- GEN:chromium-version -->115.0.5790.24<!-- GEN:stop --> ||||
1717
| WebKit <!-- GEN:webkit-version -->16.4<!-- GEN:stop --> ||||
18-
| Firefox <!-- GEN:firefox-version -->108.0.2<!-- GEN:stop --> ||||
18+
| Firefox <!-- GEN:firefox-version -->113.0<!-- GEN:stop --> ||||
1919

2020
Headless execution is supported for all the browsers on all platforms.
2121

assertions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type expectedTextValue struct {
4242
type frameExpectOptions struct {
4343
ExpressionArg interface{} `json:"expressionArg"`
4444
ExpectedText []expectedTextValue `json:"expectedText"`
45-
ExpectedNumber *int `json:"expectedNumber"`
45+
ExpectedNumber *float64 `json:"expectedNumber"`
4646
ExpectedValue interface{} `json:"expectedValue"`
4747
UseInnerText *bool `json:"useInnerText"`
4848
IsNot bool `json:"isNot"`

browser.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,8 @@ func (b *browserImpl) NewContext(options ...BrowserNewContextOptions) (BrowserCo
7272
return nil, fmt.Errorf("could not send message: %w", err)
7373
}
7474
context := fromChannel(channel).(*browserContextImpl)
75-
context.options = &option
76-
b.Lock()
77-
b.contexts = append(b.contexts, context)
78-
b.Unlock()
7975
context.browser = b
80-
context.setBrowserType(b.browserType.(*browserTypeImpl))
76+
b.browserType.(*browserTypeImpl).didCreateContext(context, &option, nil)
8177
return context, nil
8278
}
8379

@@ -120,7 +116,7 @@ func (b *browserImpl) Close() error {
120116
b.isClosedOrClosing = true
121117
b.Unlock()
122118
_, err := b.channel.Send("close")
123-
if err != nil {
119+
if err != nil && !isSafeCloseError(err) {
124120
return fmt.Errorf("could not send message: %w", err)
125121
}
126122
if b.shouldCloseConnectionOnClose {
@@ -169,13 +165,6 @@ func (b *browserImpl) onClose() {
169165
b.Unlock()
170166
}
171167

172-
func (b *browserImpl) setBrowserType(bt *browserTypeImpl) {
173-
b.browserType = bt
174-
for _, c := range b.contexts {
175-
c.(*browserContextImpl).setBrowserType(bt)
176-
}
177-
}
178-
179168
func newBrowser(parent *channelOwner, objectType string, guid string, initializer map[string]interface{}) *browserImpl {
180169
b := &browserImpl{
181170
isConnected: true,

0 commit comments

Comments
 (0)