Could I use Capybara on frameworks outside Rails (PHP)? -


i test php web app (specifically magento) capybara. i've used capybara success when used rails before want replicate success. know if possible or maybe there capybara php?

yes possible. have define url server serves pages want test. example, if use rspec in spec_helper.rb. additionally have specify different driver not want start app (which not present), example selenium:

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

a basic gemfile this:

source 'https://rubygems.org'  gem "rspec", '~> 3.0' gem "capybara" gem "selenium-webdriver", '~> 2.45' 

if run tests, fire browser window (if browser installed in non default path have configure this, too), open page , interact it.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -