Created
October 22, 2013 19:49
-
-
Save dwelch2344/7107006 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
"""Be sure to use the latest selenium version | |
as there might be some problems with JSON serialization | |
Before running the test make sure you started appium server | |
with TestApp app: grunt appium:TestApp | |
""" | |
import unittest | |
import os | |
import sys | |
from random import randint | |
from selenium import webdriver | |
class TestSequenceFunctions(unittest.TestCase): | |
def setUp(self): | |
# set up appium | |
app = os.path.join(os.path.dirname(__file__), | |
'/Users/dave/Desktop', | |
'TapMe.app') | |
app = os.path.abspath(app) | |
# app = sys.argv[1] | |
self.driver = webdriver.Remote( | |
command_executor='http://127.0.0.1:4723/wd/hub', | |
desired_capabilities={ | |
'browserName': 'iOS', | |
'platform': 'Mac', | |
'version': '6.0', | |
'app': app | |
}) | |
self._values = [] | |
def test_ui_computation(self): | |
# trigger computation by using the button | |
buttons = self.driver.find_elements_by_tag_name("button") | |
for i in range(0, 3): | |
buttons[0].click() | |
def tearDown(self): | |
self.driver.quit() | |
if __name__ == '__main__': | |
# if len(sys.argv) < 2: | |
# print 'Please provide the path to the app. Usage: python simple.py [app-path]' | |
# sys.exit(2); | |
# print 'Starting unit test for app: ', sys.argv[1] | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment