2017-04-21 14:06:53 +01:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
from appium import webdriver
|
|
|
|
|
|
|
|
|
|
|
|
class MSiteChromeAndroidUITests(unittest.TestCase):
|
|
|
|
|
|
|
|
def setUp(self):
|
2017-04-24 14:50:18 +01:00
|
|
|
|
|
|
|
# Default google chrome does not exist for android < 6.0
|
2017-04-21 14:06:53 +01:00
|
|
|
desired_caps = {
|
|
|
|
'platformName': 'Android',
|
|
|
|
'deviceName': 'Android Emulator',
|
|
|
|
'appPackage': 'com.android.chrome',
|
|
|
|
'appActivity': 'com.google.android.apps.chrome.Main',
|
2017-05-29 13:34:35 +01:00
|
|
|
'browserName': 'chrome',
|
|
|
|
'ignore-certificate-errors': True
|
2017-04-21 14:06:53 +01:00
|
|
|
}
|
2017-05-29 13:34:35 +01:00
|
|
|
self.driver = webdriver.Remote('http://127.0.0.1:4444/wd/hub', desired_caps)
|
2017-04-21 14:06:53 +01:00
|
|
|
|
|
|
|
def test_open_url(self):
|
|
|
|
self.driver.get('http://targeturl.com')
|
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
self.driver.quit()
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
suite = unittest.TestLoader().loadTestsFromTestCase(MSiteChromeAndroidUITests)
|
|
|
|
unittest.TextTestRunner(verbosity=2).run(suite)
|