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


Python home.Home类代码示例

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


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

示例1: test_reviews_section

    def test_reviews_section(self, mozwebqa):
        """https://moztrap.mozilla.org/runtests/run/243/env/112/ - Verify details page for an app - Reviews section"""
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        # click first app and load its Details Page
        search_term = self._take_first_popular_app_name(mozwebqa)
        details_page = home_page.search_and_click_on_app(search_term)

        # This takes the number of reviews on the details page and based on that number it treats 3 different scenarios:
        # when the app has reviews, when it has 1 review and when the app isn't rated.
        if details_page.is_app_rated:
            if details_page.reviews_count >= 2:
                if len(details_page.reviews) == 2:
                    for review in details_page.reviews:
                        Assert.true(review.is_visible)
            elif details_page.reviews_count == 1:
                Assert.true(details_page.reviews[0].is_visible)
        else:
            Assert.equal(details_page.app_not_rated_text, 'App not yet rated')

        Assert.true(details_page.is_write_a_review_button_visible)

        for support_button in details_page.support_buttons_list:
            Assert.true(details_page.is_element_visible(*support_button))
开发者ID:AndreiH,项目名称:marketplace-tests,代码行数:25,代码来源:test_details_page.py

示例2: test_that_after_writing_a_review_clicking_back_goes_to_app_page

    def test_that_after_writing_a_review_clicking_back_goes_to_app_page(self, mozwebqa, new_user):
        """Logged out, click "Write a Review" on an app page, sign in, submit a review,
        click Back, test that the current page is the app page.
        """
        mock_review = MockReview()

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        details_page = home_page.go_to_first_free_app_page()
        assert details_page.is_product_details_visible
        app_name = details_page.title

        # Write a review.
        review_box = details_page.click_write_review()
        details_page.login(new_user["email"], new_user["password"])

        review_box.write_a_review(mock_review["rating"], mock_review["body"])

        assert "Your review was successfully posted. Thanks!" == details_page.notification_message
        details_page.wait_notification_box_not_visible()

        # Go to the reviews page
        reviews_page = details_page.click_view_reviews()
        reviews_page.header.click_back()
        assert details_page.is_product_details_visible
        assert app_name == details_page.title
开发者ID:ithompson4,项目名称:marketplace-tests,代码行数:27,代码来源:test_reviews.py

示例3: test_that_after_writing_a_review_clicking_back_goes_to_app_page

    def test_that_after_writing_a_review_clicking_back_goes_to_app_page(self, mozwebqa):
        """Logged out, click "Write a Review" on an app page, sign in, submit a review,
        click Back, test that the current page is the app page.
        """
        mock_review = MockReview()

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        # Search for an app and go to it's details page.
        search_page = home_page.search_for(self.app_name)

        details_page = search_page.results[0].click_app()

        Assert.true(details_page.is_product_details_visible)

        # Write a review.
        details_page.click_write_review()
        details_page.login_with_user_from_other_pages(user="default")
        add_review_page = AddReview(mozwebqa)
        review_page = add_review_page.write_a_review(mock_review['rating'], mock_review['body'])

        review_page.wait_for_ajax_on_page_finish()
        review_page.wait_for_reviews_visible()
        Assert.true(review_page.is_successful_message, "Review not added: %s" % review_page.notification_message)

        # After clicking back, current page is the app's details page.
        review_page.header.click_back()

        Assert.true(details_page.is_product_details_visible)
        Assert.equal(self.app_name, details_page.title)
开发者ID:brkeerthi,项目名称:marketplace-tests,代码行数:31,代码来源:test_reviews.py

示例4: test_that_after_writing_a_review_clicking_back_goes_to_app_page

    def test_that_after_writing_a_review_clicking_back_goes_to_app_page(self, mozwebqa):
        """Logged out, click "Write a Review" on an app page, sign in, submit a review,
        click Back, test that the current page is the app page.
        """
        mock_review = MockReview()

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        # Search for an app and go to it's details page.
        search_page = home_page.search_for(self.app_name)
        details_page = search_page.results[0].click_app()

        Assert.true(details_page.is_product_details_visible)

        # Write a review.
        review_box = details_page.click_write_review()
        details_page.login_with_user_from_other_pages(user="default")
        review_box.write_a_review(mock_review['rating'], mock_review['body'])

        Assert.equal(details_page.notification_message, "Your review was posted")

        # Go to the reviews page and delete the review
        reviews_page = details_page.click_view_reviews()
        reviews = reviews_page.reviews[0]
        reviews.delete()
        reviews_page.wait_notification_box_visible()

        Assert.equal(details_page.notification_message, "Your review was deleted")

        # After clicking back, current page is the app's details page.
        reviews_page.header.click_back()

        Assert.true(details_page.is_product_details_visible)
        Assert.equal(self.app_name, details_page.title)
开发者ID:vaidik,项目名称:marketplace-tests,代码行数:35,代码来源:test_reviews.py

示例5: test_searching_with_no_matching_results

    def test_searching_with_no_matching_results(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        search_page = home_page.search_for(self.search_term_with_no_result)

        Assert.equal("No results found", search_page.no_results_text)
开发者ID:viorelaioia,项目名称:marketplace-tests,代码行数:7,代码来源:test_search.py

示例6: test_that_searching_with_empty_field_returns_results

    def test_that_searching_with_empty_field_returns_results(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        search_page = home_page.search_for("")

        Assert.greater(len(search_page.results), 0)
开发者ID:viorelaioia,项目名称:marketplace-tests,代码行数:7,代码来源:test_search.py

示例7: test_category_items

    def test_category_items(self, mozwebqa):
        home = Home(mozwebqa)
        home.tab("Categories").click()
        Assert.true(home.is_categories_region_visible)

        for i in range(len(home.categories)):
            Assert.equal(home.categories[i].name, self.expected_category_items[i])
开发者ID:rbillings,项目名称:Addon-Tests,代码行数:7,代码来源:test_home.py

示例8: test_that_verifies_categories_menu

    def test_that_verifies_categories_menu(self, mozwebqa):

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        categories = home_page.nav_menu.click_categories()
        Assert.greater(len(categories.categories), 0)
开发者ID:decode-dev,项目名称:marketplace-tests,代码行数:7,代码来源:test_home_page.py

示例9: test_that_after_writing_a_review_clicking_back_goes_to_app_page

    def test_that_after_writing_a_review_clicking_back_goes_to_app_page(self, mozwebqa):
        """Logged out, click "Write a Review" on an app page, sign in, submit a review,
        click Back, test that the current page is the app page.
        """
        mock_review = MockReview()

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        details_page = home_page.go_to_first_free_app_page()
        Assert.true(details_page.is_product_details_visible)
        app_name = details_page.title

        # Write a review.
        review_box = details_page.click_write_review()
        acct = self.create_new_user(mozwebqa)
        details_page.login(acct)

        review_box.write_a_review(mock_review['rating'], mock_review['body'])

        Assert.equal(details_page.notification_message, "Your review was successfully posted. Thanks!")
        details_page.wait_notification_box_not_visible()

        # Go to the reviews page
        reviews_page = details_page.click_view_reviews()
        reviews_page.header.click_back()

        Assert.true(details_page.is_product_details_visible)
        Assert.equal(app_name, details_page.title)
开发者ID:decode-dev,项目名称:marketplace-tests,代码行数:29,代码来源:test_reviews.py

示例10: test_that_verifies_categories_section

    def test_that_verifies_categories_section(self, mozwebqa):

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        Assert.true(home_page.is_category_section_visible)
        Assert.equal(len(home_page.categories), 9)
开发者ID:bebef1987,项目名称:marketplace-tests,代码行数:7,代码来源:test_home_page.py

示例11: test_that_verifies_featured_application_section

    def test_that_verifies_featured_application_section(self, mozwebqa):

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        # Check if featured section is visible and contains applications
        Assert.true(home_page.is_featured_section_visible)
        Assert.equal(home_page.featured_section_elements_count, 6)
开发者ID:teodosia,项目名称:marketplace-tests,代码行数:8,代码来源:test_home_page.py

示例12: test_that_checks_the_vote_of_an_article

    def test_that_checks_the_vote_of_an_article(self, base_url, selenium):
        home = Home(base_url, selenium).open()

        article_page = home.search_for('firefox').results[0].click()
        assert '| Mozilla Support' in article_page.page_title
        assert 'Was this article helpful?' == article_page.helpful_header_text

        article_page.click_helpful_button()
        article_page.wait_for_vote_message_text(u'Glad to hear it \u2014 thanks for the feedback!')
开发者ID:1234-,项目名称:kitsune,代码行数:9,代码来源:test_article.py

示例13: test_user_can_login_and_logout

 def test_user_can_login_and_logout(self, base_url, selenium, new_user):
     home_page = Home(base_url, selenium)
     home_page.go_to_homepage()
     home_page.more_menu.click_sign_in()
     home_page.login(new_user['email'], new_user['password'])
     settings_page = home_page.more_menu.click_settings()
     assert new_user['email'] == settings_page.email_text
     home_page = settings_page.more_menu.click_sign_out()
     assert home_page.is_sign_in_visible
开发者ID:diox,项目名称:marketplace-tests,代码行数:9,代码来源:test_users_account.py

示例14: test_searching_with_no_matching_results

    def test_searching_with_no_matching_results(self, mozwebqa):
        search_term_with_no_result = 'abcdefghij'

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        search_page = home_page.header.search(search_term_with_no_result)

        Assert.equal('No results found', search_page.no_results_text)
开发者ID:decode-dev,项目名称:marketplace-tests,代码行数:9,代码来源:test_search.py

示例15: test_all_featured_extensions_link

    def test_all_featured_extensions_link(self, mozwebqa):
        home = Home(mozwebqa)
        assert home.is_the_current_page
        assert 'Featured' == home.default_selected_tab_text

        featured_extensions = home.click_all_featured_addons_link()
        assert 'ADD-ONS' == featured_extensions.title
        assert 'Featured Extensions' == featured_extensions.page_header
        assert 'sort=featured' in featured_extensions.get_url_current_page()
开发者ID:adini121,项目名称:Addon-Tests,代码行数:9,代码来源:test_home.py


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