Capybara integration with page-objects gem
Asked Answered
M

3

7

Is it possible to use the page-object gem and capybara to automate Ruby on Rails testing? When I attempt to access a page object after starting up my test I receive the following error:

Unable to pick a platform for the provided browser (RuntimeError)

This makes sense as I think I'd have to pass the browser instance of capybara to the page-object, not sure if anyone else has tried this before.

Microcosm answered 14/1, 2012 at 23:59 Comment(0)
B
6

There is a gem that lets you use the Page Object pattern with capybara: SitePrism. Find it here: https://github.com/natritmeyer/site_prism

Brushoff answered 7/6, 2012 at 15:44 Comment(0)
M
3

Currently there is no support for capybara but it has been requested a few times. Part of the challenge is that the API was built upon selenium and watir which are much richer than capy and in it would be a very large undertaking to build add that functionality to the page-object gem to make capy behave the same way.

I've thought several times about splitting the page-object gem into a "basic" form that will allow capybara to utilize and an "advanced" form that will add the additional capabilities found in selenium and watir but haven't seen enough demand.

Marcoux answered 12/5, 2012 at 12:18 Comment(0)
R
1

https://github.com/andyw8/capybara-page-object looks like it started existing in the last 8 months or so.

Ribaudo answered 20/11, 2012 at 15:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.