示例#1
0
 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()
示例#2
0
    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()
示例#3
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     self.k = knowledge.Knowledge('test')
     self.r = knowledge.RawData('test')