Added examples UI tests for msite
This commit is contained in:
parent
d14107f05a
commit
38a827fee1
30
example/android/python/msite_simple_chrome.py
Normal file
30
example/android/python/msite_simple_chrome.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
import unittest
|
||||
|
||||
from appium import webdriver
|
||||
|
||||
|
||||
class MSiteChromeAndroidUITests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
desired_caps = {
|
||||
'platformName': 'Android',
|
||||
'deviceName': 'Android Emulator',
|
||||
'platformVersion': '4.2',
|
||||
# For emulator type armeabi, please use browser apk :
|
||||
# /root/browser_apk/chrome_55.0.2883.91-288309100_min_android4.1_armeabi-v7a.apk
|
||||
'app': '/root/browser_apk/chrome_55.0.2883.91_min_android4.1_x86.apk',
|
||||
'appPackage': 'com.android.chrome',
|
||||
'appActivity': 'com.google.android.apps.chrome.Main',
|
||||
'avd': 'emulator_4.2.2'
|
||||
}
|
||||
self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
|
||||
|
||||
def test_open_google(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)
|
27
example/android/python/msite_simple_default_browser.py
Normal file
27
example/android/python/msite_simple_default_browser.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import unittest
|
||||
|
||||
from appium import webdriver
|
||||
|
||||
|
||||
class MSiteDefaultBrowserAndroidUITests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
desired_caps = {
|
||||
'platformName': 'Android',
|
||||
'deviceName': 'Android Emulator',
|
||||
'platformVersion': '4.2',
|
||||
'appPackage': 'com.android.browser',
|
||||
'appActivity': 'com.android.browser.BrowserActivity',
|
||||
'avd': 'emulator_4.2.2'
|
||||
}
|
||||
self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
|
||||
|
||||
def test_open_google(self):
|
||||
self.driver.get('http://targeturl.com')
|
||||
|
||||
def tearDown(self):
|
||||
self.driver.quit()
|
||||
|
||||
if __name__ == '__main__':
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(MSiteDefaultBrowserAndroidUITests)
|
||||
unittest.TextTestRunner(verbosity=2).run(suite)
|
30
example/android/python/msite_simple_firefox.py
Normal file
30
example/android/python/msite_simple_firefox.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
import unittest
|
||||
|
||||
from appium import webdriver
|
||||
|
||||
|
||||
class MSiteFirefoxAndroidUITests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
desired_caps = {
|
||||
'platformName': 'Android',
|
||||
'deviceName': 'Android Emulator',
|
||||
'platformVersion': '4.2',
|
||||
# For emulator type armeabi, please use browser apk :
|
||||
# /root/browser_apk/firefox_51.0-2015466281_min_android4.0.3_armeabi-v7a.apk
|
||||
'app': '/root/browser_apk/firefox_51.0-2015466284_min_android4.0.3_x86.apk',
|
||||
'appPackage': 'org.mozilla.firefox',
|
||||
'appActivity': 'org.mozilla.gecko.LauncherActivity',
|
||||
'avd': 'emulator_4.2.2'
|
||||
}
|
||||
self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
|
||||
|
||||
def test_open_google(self):
|
||||
self.driver.get('http://targeturl.com')
|
||||
|
||||
def tearDown(self):
|
||||
self.driver.quit()
|
||||
|
||||
if __name__ == '__main__':
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(MSiteFirefoxAndroidUITests)
|
||||
unittest.TextTestRunner(verbosity=2).run(suite)
|
|
@ -1 +1 @@
|
|||
Appium-Python-Client==0.23
|
||||
Appium-Python-Client==0.24
|
||||
|
|
Loading…
Reference in a new issue