Example #1
0
    def test_launching(self):
        """
        验证launching是否能正常打开并跳转;

        1、打开首页;

        2、点击launching;

        3、断言跳转的url是否包含{/news/47.html}
        """
        try:
            driver = HomeElement(self.driver)
            driver.get(self.url)
            driver.new_table_click(location=3)
            driver.full_windows_screen(self.screenshots_path, 1920, 980)
            self.first = driver.news_assert(url=self.data[0])  # 此项为必填,第一个断言值
            self.assertEqual(self.first, self.second)
        except Exception:
            self.error = str(traceback.format_exc())
Example #2
0
    def test_contact_us(self):
        """
        验证ContactUs是否能正常打开;

        1、打开首页;

        2、点击ContactUs;

        3、断言跳转的url是否包含{/nav/24.html}
        """
        try:
            driver = HomeElement(self.driver)
            driver.get(self.url)
            driver.table_click(location=4)
            driver.full_windows_screen(self.screenshots_path, 1920, 980)
            self.first = driver.is_url_contain(
                url=self.data[0])  # 此项为必填,第一个断言值
            self.assertEqual(self.first, self.second)
        except Exception:
            self.error = str(traceback.format_exc())