def setUp(self) -> None: """ 执行每个用例之前执行 打开浏览器,打开被测网址 :return: """ driver = open_browser() self.browse = BrowseGoods(driver) self.browse.open_url(url)
def setUp(self) -> None: ''' 打开浏览器,打开测试网址 登录被测网址 ''' driver = open_browser() self.orderPay = OrderPay_page(driver) #下单支付对象 self.car = ShoppingCarPage(driver) #购物车对象 self.orderPay.open_url(url) lf = LoginFlow(driver) lf.login_not_remember_password("user123", '123456') lf.back_homepage() time.sleep(3)
def setUp(self) -> None: ''' 打开浏览器,打开测试网址 登录被测网址 ''' file = Constructdata() # 获取必填项的随机注册数据----字典格式 self.require_datas = file.get_require_options_register_data() # print(self.require_datas) # 把字典格式转为列表格式 require_data_list = file.get_dict_value_to_list(self.require_datas) # 把数据写入表格中 OperationExcel(r"E:\个人练习\12_自动化项目_llj\ECShop\data\registerdata.xls" ).wirte_excel(require_data_list) driver = open_browser() self.register = RegsiterPage(driver) self.register.open_url(url)
# 接受单选框 def reg_agreement(self): self.click_one_checkbox(self._reg_agreement) # 用户协议连接 def reg_user_agreement_link(self): self.click(self._reg_user_agreement_link) # 立即注册按钮 def reg_submit_btn(self): self.click(self._reg_submit_btn) # 我已有账号,我要登录连接 def reg_have_user_link(self): self.click(self._reg_have_user_link) # 你忘记,密码了吗?连接 def reg_forget_password_link(self): self.click(self._reg_forget_password_link) if __name__ == '__main__': driver = open_browser() page = RegditPage(driver) page.open_url(regdit_url) page.input_nuername('cc2222') page.time_sleep(2) page.input_email('*****@*****.**') page.input_password('ws123456ws') page.time_sleep(3) page.input_repassword('ws123456ws') page.time_sleep(3) page.close_browser()