Skip to content

Instantly share code, notes, and snippets.

@ndmanvar
Created May 2, 2017 20:33
Show Gist options
  • Save ndmanvar/38edf6018c5ca9285ae0bd552efa7900 to your computer and use it in GitHub Desktop.
Save ndmanvar/38edf6018c5ca9285ae0bd552efa7900 to your computer and use it in GitHub Desktop.
import os
import unittest
from appium import webdriver
class TestClass(unittest.TestCase):
def setUp(self):
caps = {}
caps['browserName'] = ""
caps['appiumVersion'] = "1.6"
caps['deviceName'] = "iPhone 7 Simulator"
caps['deviceOrientation'] = "portrait"
caps['platformVersion'] = "10.0"
caps['platformName'] = "iOS"
caps['app'] = "https://github.com/saucelabs-sample-test-frameworks/Java-Junit-Appium-iOS/blob/master/resources/SauceGuineaPig-sim-debug.app.zip?raw=true"
username = os.environ['SAUCE_USERNAME']
access_key = os.environ['SAUCE_ACCESS_KEY']
self.driver = webdriver.Remote(
command_executor = "http://%s:%[email protected]:80/wd/hub" % (username, access_key),
desired_capabilities = caps)
self.driver.implicitly_wait(10)
def test_settings(self):
# home button to get out of app
self.driver.background_app(-1)
# home button again to get to home/base screen
self.driver.background_app(-1)
# click settings
self.driver.find_element_by_accessibility_id("Settings").click()
# click general
self.driver.find_element_by_accessibility_id("General").click()
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment