当前位置: 首页>>代码示例>>Python>>正文


Python Home.categories方法代码示例

本文整理汇总了Python中pages.home.Home.categories方法的典型用法代码示例。如果您正苦于以下问题:Python Home.categories方法的具体用法?Python Home.categories怎么用?Python Home.categories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pages.home.Home的用法示例。


在下文中一共展示了Home.categories方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_that_category_names_are_correct

# 需要导入模块: from pages.home import Home [as 别名]
# 或者: from pages.home.Home import categories [as 别名]
    def test_that_category_names_are_correct(self, mozwebqa):
        """Test for Litmus 25795"""

        expected_categories = [
            "Alerts & Updates",
            "Appearance",
            "Bookmarks",
            "Download Management",
            "Feeds, News & Blogging",
            "Games & Entertainment",
            "Language Support",
            "Photos, Music & Videos",
            "Privacy & Security",
            "Shopping",
            "Social & Communication",
            "Tabs",
            "Web Development",
            "Other"]

        # Get actual categories
        home_page = Home(mozwebqa)
        categories = home_page.categories()

        # Catch extra/missing categories with a simple count check
        Assert.equal(len(categories), len(expected_categories))

        # Check the categories that are there against the expected list
        for category in categories:
            Assert.contains(category.name, expected_categories)
开发者ID:johnny-c,项目名称:Addon-Tests,代码行数:31,代码来源:test_categories.py

示例2: test_that_all_category_links_work

# 需要导入模块: from pages.home import Home [as 别名]
# 或者: from pages.home.Home import categories [as 别名]
    def test_that_all_category_links_work(self, mozwebqa):
        "Test for Litmus 25796"
        home_page = Home(mozwebqa)
        categories = home_page.categories()

        for category in categories:
            category_name = category.name
            category_page = category.click_link()
            Assert.contains(category_name, category_page.category_page_title)
            Assert.equal(category_name, category_page.category_header_title)
            home_page = Home(mozwebqa)
开发者ID:johnny-c,项目名称:Addon-Tests,代码行数:13,代码来源:test_categories.py


注:本文中的pages.home.Home.categories方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。