第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

python 中unittest單元測(cè)試為什么addTest沒(méi)用。

python 中unittest單元測(cè)試為什么addTest沒(méi)用。

wvguugvvc 2017-09-05 22:35:56
#!?/usr/bin/env?python #!?-*-cording:utf-8?-*- import?unittest from?appium?import?webdriver import?time #腳本初始化獲取操作實(shí)例 class?MyTestCase(unittest.TestCase): ???? ????def?setUp(self): ????????desired_caps={} ????????desired_caps['platformName']='Android' ????????desired_caps['platformVersion']='7.1.1' ????????desired_caps['deviceName']='Galaxy?Note8' ????????desired_caps['appPackage']='com.sec.android.app.popupcalculator' ????????desired_caps['appActivity']='.Calculator?' ????????desired_caps['unicodeKeyboard']='True' ????????desired_caps['resetKeyboard']='False' ????????self.driver=webdriver.Remote("http://localhost:4723/wd/hub",desired_caps) ??? ????def?tearDown(self): ????????self.driver.quit() ????def?testAdd(self): ????????number8=self.driver.find_element_by_id("bt_08") ????????number8.click() ????????numberadd=self.driver.find_element_by_id("bt_add") ????????numberadd.click() ????????number5=self.driver.find_element_by_id("bt_05") ????????number5.click() ????????equal=self.driver.find_element_by_id("bt_equal") ????????equal.click() ????????try: ????????????result=self.driver.find_element_by_id('txtCalc') ????????????value=result.text ????????????self.assertEqual(u"13",value) ????????except?Exception: ????????????print?("程序出現(xiàn)異常了") ????????????self.fail("程序出現(xiàn)異常") ??????? ?? ????def?testmoreAPI(self): ????????self.driver.flick(100,750,100,100) ????????print(self.driver.wait_activity('.Calculator',3,1)) ????????time.sleep(5) ????def?get_suite(self): ?????? ????if?__name__?==?'__main__': ?????????suite?=?unittest.TestSuite() ?????????suite.addTests(MyTestCase('testmoreAPI')) ????????? ?????????runner=unittest.TextTestRunner(verbosity=2) ?????????runner.run(suit)初學(xué)python的unittest部分 ,如果我只想執(zhí)行testmoreAPI測(cè)試方法,這種寫法可以嗎?為什么執(zhí)行的時(shí)候,還是從testAdd開始執(zhí)行了?【不需要執(zhí)行testAdd】
查看完整描述

1 回答

?
慕運(yùn)維539141

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個(gè)贊

https://img1.sycdn.imooc.com//5b55a1ab0001d48a03770711.jpg選擇這個(gè)運(yùn)行

查看完整回答
反對(duì) 回復(fù) 2018-07-23
  • 1 回答
  • 0 關(guān)注
  • 4261 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)