def test_login_pass(self, driver, host): '''禅道-登录成功案例''' _login(driver, host, "admin", "123456") result2 = _login_result(driver, "admin") print("登录结果:%s" % result2) assert result2
self.sendKeys(self.loc_input_title, title) # 输入body frame = self.findElement(("class name", "ke-edit-iframe")) self.driver.switch_to.frame(frame) # 富文本不能clear body = '''[测试步骤]xxx [结果]xxx [期望结果]xxx ''' self.sendKeys(self.loc_input_body, body) self.driver.switch_to.default_content() self.click(self.loc_avse) def is_add_bug_sucess(self): return self.findElement(self.loc_new) if __name__ == "__main__": from page.login_page import _login driver = webdriver.Firefox() _login(driver, "http://127.0.0.1") bug = AddBugPage(driver) timestr = time.strftime("%Y_%m_%d_%H_%M_%S") title = "测试提交BUG" + timestr bug.add_bug(title) result = bug.is_add_bug_sucess(title) print(result)
def test_login_fail(self, driver, host): """禅道-登录失败案例:admin111-111111""" _login(driver, host, "admin111", "111111") result1 = _get_alert(driver) print("测试结果:%s" % result1) assert "登录失败" in result1
def login(driver, host): """登录功能fixture""" _login(driver, host)
def purchasedAccountLogin(driver, host): """未开户登录功能fixture""" _login(driver, host,user="******", psw="a111111") yield
def unopenedAccountLogin(driver, host): """未开户登录功能fixture""" _login(driver, host,user="******", psw="111111b")
def openedAccountLogin(driver, host): """已开户登录功能fixture""" _login(driver, host)