playwright-go icon indicating copy to clipboard operation
playwright-go copied to clipboard

[bug/issue] Locator option Has does not work correctly

Open sttaran opened this issue 3 years ago • 0 comments

I have 2 points about locators.

  1. When we create new Locator using Page we can pass PageLocatorOptions. But now if we pass Has option it does not work correctly and returns an error with message "Malformed token".

For example, this code will return the error because of wrong selector concatenation.

  inputLocator, err := page.Locator("input[name='some']")
  require.NoError(t, err)

  listLocator, err := page.Locator("ul", playwright.PageLocatorOptions{Has: inputLocator})
  require.NoError(t, err)

   text, err := listLocator.InnerText()
  1. The Locator.Locator method does not have a LocatorLocatorOptions parameter. It would be very useful to add the ability to use this option

sttaran avatar May 16 '22 08:05 sttaran