Exemplo n.º 1
0
class test_f(unittest.TestCase,Page,check):
    browser = yl['t_wc']['browser']
    url = yl['t_wc']['url']

    def setUp(self):
        self.driver = Driver(self.browser).open_browser(self.url)
    def tearDown(self):
        logger.info('测试完成,现在退出')
        self.driver.quit()

    def test_fn(self):
        self.click("t_fun","fun")
        self.click("t_fun","free")
        url = self.driver.current_url
        t_url = yl["t_fun"]["url"]
        self.check_url(url,t_url,"free")
        self.driver.back()
        self.click("t_fun","use_now")
        url = self.driver.current_url
        t_url = yl["t_fun"]["price_url"]
        self.check_url(url,t_url,"price")
        self.driver.back()
    def test_support(self):
        self.click("t_fun","support")
        url = self.driver.current_url
        t_url = yl["t_fun"]["support_url"]
        self.check_url(url,t_url,"support")
        self.driver.back()
Exemplo n.º 2
0
class test_use(unittest.TestCase, Page, check):
    browser = yl['t_wc']['browser']
    url = yl['t_wc']['url']

    def setUp(self):
        self.driver = Driver(self.browser).open_browser(self.url)

    def tearDown(self):
        logger.info("测试完成,现在退出")
        self.driver.quit()

    def test_1_use(self):
        #检查url是否正确
        self.click("t_use", "t_cli")

        self.click("t_use", "quick")
        url = self.driver.current_url
        t_url = yl["t_use"]["quick"]
        self.check_url(url, t_url, "quick")
        self.driver.back()

        self.click("t_use", "Xadmin")
        url = self.driver.current_url
        t_url = yl["t_use"]["Xadmin"]
        self.check_url(url, t_url, "Xadmin")
        self.driver.back()

        self.click("t_use", "CMS")
        url = self.driver.current_url
        t_url = yl["t_use"]["CMS"]
        self.check_url(url, t_url, "CMS")
        self.driver.back()

        self.click("t_use", "LMS")
        url = self.driver.current_url
        t_url = yl["t_use"]["LMS"]
        self.check_url(url, t_url, "LMS")
        self.driver.back()