Can I use Capybara for frameworks outside of Rails (PHP)?

I would like to test my php web application (specifically Magento) with Capybara. I used Capybara with success when I used rails before, so I want to reproduce the success. Does anyone know if this is possible or maybe Capybara for php?

+4
source share
1 answer

Yes it is possible. You must specify the URL where your server serves the pages you want to check. For example, if you use rspec, just do it in spec_helper.rb. In addition, you need to specify another driver that does not want to run the application (which is not), for example selenium:

Capybara.app_host = 'http://www.site-to-test.com' # where your site lives
Capybara.default_driver = :selenium # use selenium to control the external browsers

The base Gemfilewill look like this:

source 'https://rubygems.org'

gem "rspec", '~> 3.0'
gem "capybara"
gem "selenium-webdriver", '~> 2.45'

, ( , ), .

+3

All Articles