def test_bmks(self): """担保无忧注册""" qds = qdsIndexPage.DDSIndexPage(self.dr) qds.into_qds_page() time.sleep(1) qds.cookies() """新版首页""" self.dr.click( "css->body > div.section-banner > div.public-navbar > div > ul > li:nth-child(1) > a" ) time.sleep(1) self.assertIn("商标注册-权大师", qds.return_title()) print(qds.return_title()) # 担保无忧注册 self.dr.click( "css->body > div.section-product.width1200 > dl > dd > div.cont-serviceItems > table > tbody > tr > td.td-cont > ul > li:nth-child(2)" ) for a in self.dr.get_elements("css->#total-price"): print("费用总计:" + a.text) aa = a.text self.dr.click( "css->body > div.section-product.width1200 > dl > dd > div.cont-btnBuy > a.btn.btn-next.buynow" ) qds.order_info() get_img(self.dr, "test_dbwy.png") qds.pay_check()
def tearDown(self): publicfunction.get_img( self.dr, strftime('%Y-%m-%d_%H_%M_%S') + "_用例执行结束" + ".jpg") self.logger.info("测试用例执行结束:" + self._testMethodName) self.logger.info( '############################### End ###############################' ) self.dr.quit()
def test_bmks(self): """保姆快速注册""" qds = qdsIndexPage.DDSIndexPage(self.dr) qds.into_qds_page() time.sleep(1) qds.cookies() """新版首页""" self.dr.click("css->body > div.section-banner > div.public-navbar > div > ul > li:nth-child(1) > a") time.sleep(1) self.assertIn("商标注册-权大师", self.dr.get_title()) print(qds.return_title()) # 保姆快速注册 self.dr.click( "css->body > div.section-product.width1200 > dl > dd > div.cont-serviceItems > table > tbody > tr > td.td-cont > ul > li.list.active") ##total-price for a in self.dr.get_elements("css->#total-price"): print("费用总计:" + a.text) aa = a.text self.dr.click( "css->body > div.section-product.width1200 > dl > dd > div.cont-btnBuy > a.btn.btn-next.buynow") self.dr.clear_type("name->ownerContactPerson","全大师") self.dr.clear_type("css->body > div.myOrder-wrap > div.section-myorder.width1200 > div > table:nth-child(2) > tbody > tr:nth-child(2) > td.td-2 > input", "15624992498") self.dr.clear_type("css->body > div.myOrder-wrap > div.section-myorder.width1200 > div > table:nth-child(2) > tbody > tr:nth-child(3) > td.td-2 > input","*****@*****.**") get_img(self.dr, "bmkstest.png") for i in self.dr.get_elements( "css->body > div.myOrder-wrap > div.section-myorder.width1200 > div > div > ul > li.row-sense > em > i"): print("总价:" + i.text) ii = i.text self.assertIn(aa, ii) print("价格一致") self.dr.click( "css->body > div.myOrder-wrap > div.section-myorder.width1200 > div > div > ul > li.row-step > a.btn-next.submitOrder") time.sleep(2) for o in self.dr.get_elements("class->payable"): print("订单提交成功,应付金额:" + o.text) oo = o.text time.sleep(2) self.assertIn(oo, ii) print("测试通过") self.dr.click("id->alisubmit")
def logoutSystem(self):#退出系统 try: self.infoPrint("退出系统") #self.click("xpath->//a[@class=' c_fff']") sleep(1) self.click(BasePageConfig.logout) sleep(2) self.windowAssertEqual("是否退出平台系统?", "注销失败") sleep(1) self.dr.element_wait(BasePageConfig.LoginButton,secs=10) except: publicfunction.get_img(self.dr, strftime('%Y-%m-%d_%H_%M_%S') + "_退出系统操作.jpg") raise
def _NNshihsiPage(self): riqi = time.strftime('%Y-%m-%d', time.localtime(time.time())) if time.localtime().tm_min > 25: shijianduan = "00:00~{}:30".format(time.localtime().tm_hour) else: shijianduan = "00:00~{}:00".format(time.localtime().tm_hour) NNshihsiPage = NNshihi.NNshihsiPage(self.dr) NNshihsiPage.openNNshihsiPage() NNshihsiPage.click_login_button() NNshihsiPage.switch_to_qqlogin_frame() NNshihsiPage.click_login_() """ 682/678账户 NNshihsiPage.write_number(440,187,riqi) NNshihsiPage.write_number(40,0,shijianduan) # 682账户 NNshihsiPage.write_number(100,0,gb_huafei682) NNshihsiPage.write_number(100,0,gb_baoguang682) NNshihsiPage.write_number(90,0,gb_dianji682) NNshihsiPage.write_number(160,0,gb_zhuce682) NNshihsiPage.write_number(70,0,gb_xiadan682) # 682账户 NNshihsiPage.write_number(-440,20,gb_huafei678) NNshihsiPage.write_number(100,0,gb_baoguang678) NNshihsiPage.write_number(90,0,gb_dianji678) NNshihsiPage.write_number(160,0,gb_zhuce678) NNshihsiPage.write_number(70,0,gb_xiadan678) time.sleep(5) # 302账户 NNshihsiPage.write_number(60,320,riqi) NNshihsiPage.write_number(90,0,shijianduan) NNshihsiPage.write_number(90,0,gb_huafei302) NNshihsiPage.write_number(90,0,gb_zhuce302) NNshihsiPage.write_number(90,0,gb_xiadan302) NNshihsiPage.write_number(90,0,gb_baoguang302) NNshihsiPage.write_number(90,0,gb_dianji302) # 303账户 NNshihsiPage.write_number(-360,30,gb_huafei303) NNshihsiPage.write_number(90,0,gb_zhuce303) NNshihsiPage.write_number(90,0,gb_xiadan303) NNshihsiPage.write_number(90,0,gb_baoguang303) NNshihsiPage.write_number(90,0,gb_dianji303) """ # 304账户 NNshihsiPage.write_number(60, 320, riqi) NNshihsiPage.write_number(90, 0, shijianduan) NNshihsiPage.write_number(90, 0, gb_huafei304) NNshihsiPage.write_number(90, 0, gb_zhuce304) NNshihsiPage.write_number(90, 0, gb_xiadan304) NNshihsiPage.write_number(90, 0, gb_baoguang304) NNshihsiPage.write_number(90, 0, gb_dianji304) # 306账户 NNshihsiPage.write_number(-360, 30, gb_huafei306) NNshihsiPage.write_number(90, 0, gb_zhuce306) NNshihsiPage.write_number(90, 0, gb_xiadan306) NNshihsiPage.write_number(90, 0, gb_baoguang306) NNshihsiPage.write_number(90, 0, gb_dianji306) get_img(NNshihsiPage.dr, imageName) time.sleep(1)