This code demonstrates how to:
-
run capybara with ios and android devices
-
configure capybara to run with a browser set in the environment
-
get firefox and chrome to simulate being an iphone, by changing the browser size and user agent
To keep the example clean, all normal test framework things like page models, have been ommitted. The interesting code is in spec/acceptance/support/browser.rb
BROWSER=<ios|chrome|chrome_iphone|firefox|ff_iphone> bundle exec rspec spec/acceptance/
Full instructions at: code.google.com/p/selenium/wiki/IPhoneDriver
-
install xcode, ios sim, blah blah
git clone https://code.google.com/p/selenium/
-
build iWebdriver.xcodeproj project and run it
BROWSER=ios bundle exec rspec spec/acceptance/
-
You need the android sdk, platform tools etc installed developer.android.com/sdk/index.html
-
You need AndroidDriver (code.google.com/p/selenium/wiki/AndroidDriver) installed on the target device (or emulator developer.android.com/tools/devices/emulator.html)
-
You need a tunnel set up ‘<sdk install dir>/platform-tools/adb forward tcp:8080 tcp:8080`
BROWSER=android bundle exec rspec spec/acceptance/
Install ChromeDriver code.google.com/p/selenium/wiki/ChromeDriver
BROWSER=chrome bundle exec rspec spec/acceptance/ BROWSER=chrome_iphone bundle exec rspec spec/acceptance/