Created
December 6, 2014 15:54
-
-
Save kuronekomichael/76440274d81f5e32c9d9 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 'selenium-webdriver' | |
require 'eyes_selenium' | |
require 'rubygems' | |
eyes = Applitools::Eyes.new | |
# This is your api key, make sure you use it in all your tests. | |
eyes.api_key = 'LZaId14atU1nIA1MQIWqPwNQvWiskKuweYAx66D1rCQ110(仮)' | |
# Setup appium - Ensure the capabilities meets your environment. | |
# Refer to http://appium.io documentation if required. | |
capabilities = { | |
'deviceName' => 'iPhone Simulator', | |
'platformName' => 'iOS', | |
# The original app from Appium github project. | |
'app' => 'https://store.applitools.com/download/iOS.TestApp.app.zip' | |
} | |
# Get a selenium web driver object. | |
wd = Selenium::WebDriver.for :remote, | |
:url => 'http://0.0.0.0:4723/wd/hub', | |
:desired_capabilities => capabilities | |
begin | |
# Start visual testing | |
eyes.test(app_name: 'iOS test application', test_name: 'Test', driver: wd) do |driver| | |
# Visual validation point #1 | |
eyes.check_window('Initial view') | |
driver.find_element(:name, 'TextField1').send_keys('3') | |
driver.find_element(:name, 'TextField2').send_keys('5') | |
driver.find_element(:name, 'ComputeSumButton').click() | |
# Visual validation point #2 | |
eyes.check_window('After compute') | |
end | |
ensure | |
wd.quit | |
eyes.abort_if_not_closed | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment