def access_web(): global driver # 前置操作 driver = BasePage.open_browser() lg = LoginPage(driver) yield driver, lg # 分割线;返回值 # 后置操作 driver.quit()
def login_success(): global driver # 前置操作 driver = BasePage.open_browser() LoginPage(driver).login(LD.success_data["用户名"], LD.success_data["密码"]) yield driver