def study_home(self, driver): with allure.step("步骤1:点击学习数据看板"): driver.click(self.L_menu.menu_study) # 点击学习数据看板 time.sleep(2) assert self.L_URL.URL_study == driver.get_url() # 断言是否进入学习数据看板页 time.sleep(1) time_tool.over_time()
def report_home(self, driver): with allure.step("步骤1:点击报告管理"): driver.click(self.L_menu.menu_report) # 点击报告管理 time.sleep(2) assert self.L_URL.URL_report == driver.get_url() # 断言是否进入报告管理页 time.sleep(1) time_tool.over_time()
def user_home(self, driver): with allure.step("步骤1:点击用户管理"): driver.click(self.L_menu.menu_user) # 点击用户管理 time.sleep(2) assert self.L_URL.URL_user == driver.get_url() # 断言是否进入用户管理页 time.sleep(1) time_tool.over_time()
def clear_home(self, driver): with allure.step("步骤1:点击学习数据管理"): driver.click(self.L_menu.menu_clear) # 点击学习数据管理 time.sleep(2) # 断言是否进入学习数据管理页 assert self.L_URL.URL_clear == driver.get_url() time.sleep(1) time_tool.over_time()
def password_home(self, driver): with allure.step("步骤1:点击修改密码"): driver.click(self.L_menu.menu_password) # 点击修改密码 time.sleep(2) # 断言是否进入修改密码页 assert self.L_URL.URL_password == driver.get_url() time.sleep(1) time_tool.over_time()
def order_home(self, driver): with allure.step("步骤1:点击订单管理"): driver.click(self.L_menu.menu_order) # 点击订单管理 time.sleep(1) with allure.step("步骤2:校验是否进入订单管理"): title = driver.get_text(self.L_public.public_title) # 断言是否进入订单管理页 assert self.L_URL.URL_order == driver.get_url() and title == "订单管理" time_tool.over_time()
def company_home(self, driver): with allure.step("步骤1:点击客户管理"): # 点击客户管理 driver.click(self.L_menu.menu_company) time.sleep(1) with allure.step("步骤2:校验是否进入客户管理"): title = driver.get_text(self.L_public.public_title) # 断言是否进入客户管理页 assert title == "客户管理" and self.L_URL.URL_company == driver.get_url( ) time_tool.over_time()
def student_preview(self, driver): with allure.step("步骤2:点击预览"): driver.click(self.L_stu.stu_preview) # 点击预览 time.sleep(0.5) flag = driver.is_ElementExist( self.L_stu.stu_preview_title) # 断言是否进入预览页 assert flag is True with allure.step("步骤3:点击预览"): driver.click(self.L_stu.stu_shut) # 关闭 driver.get_url() assert "studentListNew" in str(driver.get_url()) # 断言是否回到学员管理页面 time.sleep(1) time_tool.over_time()
def channel_delete(self, driver): with allure.step("步骤1:点击删除渠道"): # 点击删除渠道 driver.click(self.L_channel.channel_delete) with allure.step("步骤2:点击确定"): driver.click(self.L_channel.delete_ok) time.sleep(1) # with allure.step("步骤2:点击取消"): # # 点击取消 # driver.click(self.lc.delete_cancel) # 断言是否删除渠道 with allure.step("步骤3:断言是否删除成功"): is_channel = db_select.select_channel("AUTO自动化测试渠道_UPDATE") assert is_channel == 0 # 断言是否回到渠道管理页 assert self.L_URL.URL_channel == driver.get_url() time.sleep(1) over_time()