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
Post a Comment