You've already forked docker-android
mirror of
https://github.com/izzy2lost/docker-android.git
synced 2026-03-10 11:37:45 -07:00
First commit
This commit is contained in:
34
example/android/python/app_simple.py
Normal file
34
example/android/python/app_simple.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import unittest
|
||||
|
||||
from appium import webdriver
|
||||
|
||||
|
||||
class SimpleAndroidUITests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
desired_caps = {
|
||||
'platformName': 'Android',
|
||||
'deviceName': 'Android Emulator',
|
||||
'platformVersion': '4.2',
|
||||
'app': '/target_apk/sample_apk_debug.apk',
|
||||
'avd': 'emulator_4.2.2'
|
||||
}
|
||||
self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
|
||||
|
||||
def tearDown(self):
|
||||
self.driver.quit()
|
||||
|
||||
def test_calculation(self):
|
||||
text_fields = self.driver.find_elements_by_class_name('android.widget.EditText')
|
||||
text_fields[0].send_keys(4)
|
||||
text_fields[1].send_keys(6)
|
||||
|
||||
btn_calculate = self.driver.find_element_by_class_name('android.widget.Button')
|
||||
btn_calculate.click()
|
||||
|
||||
self.assertEqual('10', text_fields[2].text)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(SimpleAndroidUITests)
|
||||
unittest.TextTestRunner(verbosity=2).run(suite)
|
||||
Reference in New Issue
Block a user