cheezy / page-object

Gem to implement PageObject pattern in watir-webdriver and selenium-webdriver
MIT License
653 stars 220 forks source link

Including page-object in the Gemfile includes watir, even if you use selenium #497

Closed ccdredzik closed 3 years ago

ccdredzik commented 3 years ago

Hi,

Would it be possible to create separate gems like:

page-object-selenium page-object-watir

That would essentially require only one of the frameworks? I believe page-object doesn't require watir to work properly, so always requiring it pollutes the dependencies of a project.

jkotests commented 3 years ago

The current design of Page-Object is very dependent on Watir.

The original design of Page-Object did have a large separation between the Selenium vs Watir support. However, this generated a lot of code duplication between Page-Object and Watir. Watir already wraps Selenium objects to provide a lot of easier to use methods. Page-Object's Selenium support basically did the same thing - ie wrap Selenium objects to provide the same functionality as Watir methods. As a result, the current design has been switched to take the Selenium object you provide, convert it to a Watir object and then use that in the Page-Object. For example, #wait_until now just delegates to Watir's respective method.

ccdredzik commented 3 years ago

Fair point, I wrote the above comment and then looked into watir more. I actually just moved our suite to watir ¯\_(ツ)_/¯