I have come across two projects one is with WATIR
cucumber feature files
and step definitions
and another one is Rspec
, capybara`` without
step definitionsand
feature files`.
In WATIR
project page_object
was used and in capybara
site_prism gem
was used.
page_object
in capybara
would that be incorrect approach? Why?The main difference between the two is supported underlying drivers, which is the part that actually interacts with the browser.
As each gem makes assumptions about the API of the driver, you cannot use unsupported drivers - ie you cannot use the Page-Object gem with Capybara.
Aside from that, it is mainly API preferences. Both gems are for creating page object models. However, the syntax for defining the page object and the methods the page object has will differ based on the preferences of each gem's author.