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


Python AddonsDetailsPage.click_addon_image方法代码示例

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


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

示例1: test_details_more_images

# 需要导入模块: from addons_site import AddonsDetailsPage [as 别名]
# 或者: from addons_site.AddonsDetailsPage import click_addon_image [as 别名]
    def test_details_more_images(self, testsetup):
        """
        Litmus 4846
        https://litmus.mozilla.org/show_test.cgi?id=4846
        """
        amo_detail_page = AddonsDetailsPage(testsetup, 'firebug')

        image_viewer = amo_detail_page.click_addon_image()
        Assert.true(image_viewer.is_visible)
        image_viewer.close()
        Assert.false(image_viewer.is_visible)

        additional_images_count = amo_detail_page.additional_images_count
        for i in range(1, additional_images_count):
            image_viewer = amo_detail_page.click_additional_image(i)
            Assert.equal(i + 1, image_viewer.current_image)
            Assert.true(image_viewer.is_visible)
            image_viewer.close()
            Assert.false(image_viewer.is_visible)

        image_viewer = amo_detail_page.click_additional_image(1)
        Assert.true(image_viewer.is_visible)

        for i in range(2, image_viewer.total_images_count + 1):
            Assert.true(image_viewer.is_visible)
            Assert.equal(i, image_viewer.current_image)
            Assert.true(image_viewer.is_close_visible)
            Assert.equal("Image %s of %s" % (i, additional_images_count + 1), image_viewer.current_number)
            if not i == image_viewer.total_images_count:
                image_viewer.click_next()

        Assert.false(image_viewer.is_next_link_visible)
        Assert.true(image_viewer.is_previous_link_visible)

        for i in range(image_viewer.total_images_count, 0, -1):
            Assert.true(image_viewer.is_visible)
            Assert.equal(i, image_viewer.current_image)
            Assert.true(image_viewer.is_close_visible)
            Assert.equal("Image %s of %s" % (i, additional_images_count + 1), image_viewer.current_number)
            if not i == 1:
                image_viewer.click_previous()

        Assert.true(image_viewer.is_next_link_visible)
        Assert.false(image_viewer.is_previous_link_visible)

        image_viewer.close()
        Assert.false(image_viewer.is_visible)
开发者ID:vladmaniac,项目名称:Addon-Tests,代码行数:49,代码来源:test_details_page.py


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