def create_bug(self, title): # opened_build -- click self.bch.click_opened_build() # build -- click self.bch.click_build() # bug_title -- input self.bch.input_bug_title(title) # submit -- click # 滚动滚动条 DriverUtil.get_driver().execute_script("window.scrollTo(0,10000)") time.sleep(1) self.bch.click_submit()
def setUpClass(cls): cls.driver = DriverUtil.get_driver() cls.ulp = UserLoginProxy() cls.myp = MyProxy() cls.qp = QaProxy() cls.bbp = BugBrowseProxy() cls.bcp = BugCreateProxy() cls.driver.get("http://demo.zentao.net/user-login.html") # 1.用户登录 cls.ulp.tester_login()
self.base_click_element(self.bbp.find_ti_bug()) # 业务层 class BugBrowseProxy: def __init__(self): self.bbh = BugBrowseHandle() # 提Bug点击进入Bug创建页面 def go_create_bug(self): self.bbh.click_ti_bug() if __name__ == '__main__': # 打开浏览器 driver = DriverUtil.get_driver() # 打开登录页面 driver.get("http://demo.zentao.net/user-login.html") # 测试登录 ulp = UserLoginProxy() ulp.tester_login() myp = MyProxy() myp.go_qa() qp = QaProxy() qp.go_bug_browse() bbp = BugBrowseProxy() bbp.go_create_bug() # 退出浏览器 time.sleep(2)
def __init__(self): self.driver = DriverUtil.get_driver()
def tearDownClass(cls): DriverUtil.quit_driver()