Пример #1
0
    def test_seal_series_or_oil_seal_info(self):
        """
        验证seal_series_or_oil_seal图片详情是否能正常跳转;

        1、打开seal_series_or_oil_seal;

        2、点击第{1}张图片;

        3、断言跳转的url是否包含{/product/139.html}
        """
        try:
            driver = ProductsElement(self.driver)
            driver.get(self.url)
            driver.img_click(location=self.data[0])
            driver.full_windows_screen(self.screenshots_path, 1920, 980)
            self.first = driver.is_url_contain(
                url=self.data[1])  # 此项为必填,第一个断言值
            self.is_asserts = True  # 断言self.first与self.second是否相等, True:相等,False:不相等
        except Exception as exc:
            self.error = str(exc)
Пример #2
0
    def test_automotive_brake(self):
        """
        验证AutomotiveBrake是否能正常跳转;

        1、打开Products;

        2、点击AutomotiveBrake;

        3、断言跳转的url是否包含{/product/7/}
        """
        try:
            driver = ProductsElement(self.driver)
            driver.get(self.url)
            driver.table_click(location=2)
            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())
Пример #3
0
    def test_seal_series_or_oil_seal(self):
        """
        验证SealSeriesOilSeal是否能正常跳转;

        1、打开Products;

        2、点击SealSeriesOilSeal;

        3、断言跳转的url是否包含{/product/9/}
        """
        try:
            driver = ProductsElement(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())
Пример #4
0
    def test_general_rubber_parts(self):
        """
        验证GeneralRubberParts是否能正常跳转;

        1、打开Products;

        2、点击GeneralRubberParts;

        3、断言跳转的url是否包含{/product/13/}
        """
        try:
            driver = ProductsElement(self.driver)
            driver.get(self.url)
            driver.table_click(location=8)
            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())