playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
1.94k stars 144 forks source link

fix: selector option.HasNotText #382

Closed hongcha98 closed 8 months ago

hongcha98 commented 8 months ago

When I use the code below, an error will be thrown painc: interface conversion: interface {} is nil, not string

locator = locator.Filter(playwright.LocatorFilterOptions{
    HasNotText: "test",
})

I checked the source code and the value obtained here is wrong

    if option.HasNotText != nil {
        selector += fmt.Sprintf(` >> internal:has-not-text=%s`, escapeForTextSelector(option.HasText, false))
    }