Created
March 28, 2017 19:27
-
-
Save ndmanvar/3bcdfb871d9cc74470ccee7d98ae2a85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec' | |
require 'capybara/rspec' | |
require 'appium_capybara' | |
Capybara.register_driver(:appium) do |app| | |
opts = {:caps=>{:platformName=>"ios", :deviceName=>"iPad Air Simulator", :platformVersion=>"9.3", :browserName=>"Safari"}, :appium_lib=>{:sauce_username=>"YOUR_SAUCE_USERNAME", :sauce_access_key=>"YOUR_SAUCE_ACCESS_KEY"}} | |
Appium::Capybara::Driver.new app, opts | |
end | |
Capybara.default_driver = :appium | |
RSpec.configure do |config| | |
config.include Capybara::DSL | |
config.include Capybara::RSpecMatchers | |
config.after(:each) do |result| | |
Capybara.current_session.driver.quit | |
end | |
end | |
# test | |
describe 'UICatalog smoke test' do | |
it 'should detect the nav bar' do | |
visit "http://en.wikipedia.org/" | |
fill_in 'search', :with => "Ramen" | |
click_button "searchButton" | |
heading = find '#firstHeading' | |
expect( heading ).to have_content "Ramen" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment