boa-constrictor icon indicating copy to clipboard operation
boa-constrictor copied to clipboard

[FEATURE]:

Open imoldfella opened this issue 2 years ago • 1 comments

Description

Appearance.Of creates a problem supporting playwright. Appearance.Of asks for a single element (driver.FindElement), but in selenium this apparently is really "find any". This violates strict mode which is a compelling feature of Playwright that if you ask for 1 element and in fact there are more than one element that matches, it throws an exception.

Alternatives

I think Appearance.Of could be changed to a count > 0 without breaking existing code, but hyrum's law suggests otherwise. Maybe a new Question needs to be posed.

The playwright driver could be forced to turn off strict mode, but this disables a useful feature.

Anything else?

No response

Commitments

  • [X] I agree to follow Boa Constrictor's Code of Conduct.
  • [ ] I want to work on this issue myself. (This is voluntary, not required.)

imoldfella avatar Jan 28 '23 22:01 imoldfella

We haven't yet made any progress on a Playwright package (unfortunately), but our initial thoughts for it were twofold:

  1. We would create a light, "native" package that provides a Playwright Ability but not much more. Folks would focus on making custom Tasks and Questions since Playwright's methods already have built-in waiting.

  2. For folks who would want to easily port tests from Selenium to Playwright, we would implement another package that would essentially be a Playwright adapter for the WebDriver Interactions. If any of those Interactions don't work or make sense for Playwright, then we could potentially exclude them or make them throw an exception. (Design TBD)

AutomationPanda avatar May 25 '23 01:05 AutomationPanda