class LoginAndroidTests(unittest.TestCase):
def setUp(self):
desired_caps={}
desired_caps['device'] = 'android'
desired_caps['platformName']='Android'
desired_caps['browserName']=''
desired_caps['platformVersion']='4.4.2'
desired_caps['deviceName']='MI NOTE LTE' # 这是测试机的型号
desired_caps['appPackage']='com.jinlufinancial.android.prometheus'
desired_caps['appActivity']='com.jinlufinancial.android.prometheus.StartMovieActivity'
self.driver=webdriver.Remote('http://localhost:4723/wd/hub,desired_caps')
def tearDown(self):
self.driver.quit()
def test_login(self):
time.sleep(10)
self.driver.findElementByAccessibilityId("百元玩电影 Link")
if name == 'main':
suite = unittest.TestLoader().loadTestsFromTestCase(LoginAndroidTests)
unittest.TextTestRunner(verbosity=2).run(suite)