Last active
March 17, 2017 02:59
-
-
Save daipresents/f12517a22655454f51c9cf913d0ccd0f 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
[caps] | |
platformName = "Android" | |
versionNumber = "1.12" | |
deviceName = "F8132" | |
app = "sample.apk" | |
[appium_lib] | |
wait = 10 |
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
module Pages | |
class LoginPage < SitePrism::Page | |
element :login_button, :id, 'com.daipresents.sample:id/login_button' | |
def tap_login_button | |
login_button.click | |
end | |
end | |
end |
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_relative 'spec_helper' | |
describe 'Login' do | |
context 'Error Case' do | |
it 'can not login without id and password' do | |
Pages::LoginPage.new | |
.tap_login_button | |
#.tap_xxxxx | |
#.tap_yyyyy | |
#.tap_zzzzz | |
end | |
end | |
end |
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 'rubygems' | |
require 'rspec' | |
require 'rspec/expectations' | |
require 'capybara/rspec' | |
require 'site_prism' | |
require 'appium_lib' | |
require 'appium_capybara' | |
Capybara.register_driver(:appium) do |app| | |
opts = Appium.load_appium_txt file: File.join(Dir.pwd, 'appium.txt') | |
Appium::Capybara::Driver.new app, opts | |
end | |
Capybara.default_driver = :appium | |
require 'login_page' | |
RSpec.configure do |config| | |
config.after(:each) do |result| | |
Capybara.current_session.driver.quit | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment