def test_search(self, paras, expected): st = setup.Setup() lg = login.Login() lg.set_driver(st.driver) driver = lg.login_action('admin','admin') driver.find_element_by_link_text('※ 知识仓库 ※').click() re= knowledge.Knowledge() re.set_driver(driver) re.search(paras) time.sleep(2) driver.quit()
def test_delete(self, paras, expected): st = setup.Setup() lg = login.Login() lg.set_driver(st.driver) driver = lg.login_action('admin','admin') driver.find_element_by_link_text('※ 知识仓库 ※').click() re= knowledge.Knowledge() re.set_driver(driver) re.dele(paras) time.sleep(2) assert_type = expected.split('=')[0] expected_str = expected.split('=')[1] # 根据excel中的字段判断调用哪种断言 if assert_type == 'assert_msg': self.assert_add_msg(driver,expected_str) driver.quit()
def setUp(self): unittest.TestCase.setUp(self) self.k = knowledge.Knowledge('test') self.r = knowledge.RawData('test')