Rails TestAdapter API for native Ferrum usage #606
YusukeIwaki
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I’m the author of playwright-ruby-client, and I’ve recently been working on rails/rails#57903 . I also maintain capybara-playwright-driver, and one motivation for this work is the considerable effort required to implement and maintain a Capybara driver layer.
The PR introduces a Capybara-independent option for Rails system tests, together with a small integration API currently called TestAdapter API.
For example, a Ferrum adapter could look like this:
Users could then select it like this:
And system tests would interact directly with Ferrum’s native objects and API:
The adapter would not wrap or normalize Ferrum’s browser API. It would only manage the lifecycle of objects such as
Ferrum::BrowserandFerrum::Pageand expose them directly to tests.My impression is that this would make integrations for Playwright and Ferrum considerably smaller and easier to maintain than Capybara drivers, while allowing users to work directly with each library’s native features.
Since Ferrum also has Cuprite as its Capybara driver, I’d be interested in your perspective:
I’m mainly interested in feedback on the API design from the perspective of someone who has experience maintaining both browser-automation library and its Capybara driver. A high-level opinion would be very helpful; there’s no need to review the entire Rails PR.
Beta Was this translation helpful? Give feedback.
All reactions