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


Python Home.go_to_homepage方法代码示例

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


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

示例1: test_reviews_section

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:27,代码来源:test_details_page.py

示例2: test_that_after_writing_a_review_clicking_back_goes_to_app_page

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:29,代码来源:test_reviews.py

示例3: test_that_after_writing_a_review_clicking_back_goes_to_app_page

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:33,代码来源:test_reviews.py

示例4: test_that_after_writing_a_review_clicking_back_goes_to_app_page

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:37,代码来源:test_reviews.py

示例5: test_that_checks_the_addition_of_a_review

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    def test_that_checks_the_addition_of_a_review(self, mozwebqa):
        mock_review = MockReview()

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        # Create new user and login.
        new_user = home_page.create_new_user()
        home_page.login(user=new_user)

        # 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()
        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()

        # Check review
        Assert.true(review_page.is_successful_message, "Review not added: %s" % review_page.notification_message)
        Assert.equal(review_page.notification_message, "Your review was successfully added!")
        review = review_page.reviews[0]
        Assert.equal(review.rating, mock_review['rating'])
        Assert.contains(review.author, new_user['email'])
        Assert.equal(review.text, mock_review['body'])
开发者ID:brkeerthi,项目名称:marketplace-tests,代码行数:32,代码来源:test_reviews.py

示例6: test_searching_with_no_matching_results

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:9,代码来源:test_search.py

示例7: test_that_searching_with_empty_field_returns_results

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:9,代码来源:test_search.py

示例8: test_that_checks_the_addition_of_a_review

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    def test_that_checks_the_addition_of_a_review(self, mozwebqa, new_user):
        mock_review = MockReview()
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.nav_menu.click_sign_in()
        home_page.login(new_user['email'], new_user['password'])

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

        # Write a review
        review_box = details_page.click_write_review()
        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()

        # Check review
        review = reviews_page.reviews[0]
        Assert.equal(review.rating, mock_review['rating'])
        Assert.contains(review.author, new_user['email'])
        Assert.contains(review.text, mock_review['body'])
开发者ID:krupa,项目名称:marketplace-tests,代码行数:27,代码来源:test_reviews.py

示例9: test_that_verifies_categories_menu

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:9,代码来源:test_home_page.py

示例10: test_that_after_writing_a_review_clicking_back_goes_to_app_page

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:31,代码来源:test_reviews.py

示例11: test_that_checks_the_addition_of_a_review

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    def test_that_checks_the_addition_of_a_review(self, mozwebqa):
        new_user = PersonaTestUser().create_user()
        mock_review = MockReview()

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        # Create new user and login.
        settings_page = home_page.header.click_settings()
        settings_page.login(user=new_user)

        # Search for an app and go to it's details page.
        home_page.go_to_homepage()
        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()
        add_review_box = AddReview(mozwebqa)
        details_page = add_review_box.write_a_review(mock_review['rating'], mock_review['body'])

        details_page.wait_for_page_to_load()
        Assert.true(details_page.is_success_message_visible, "Review not added: %s" % details_page.success_message)
        Assert.equal(details_page.success_message, "Your review was posted")

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

        # Check review
        review = reviews_page.reviews[0]
        Assert.equal(review.rating, mock_review['rating'])
        Assert.contains(review.author, new_user['email'])
        Assert.equal(review.text, mock_review['body'])
开发者ID:erichwelz,项目名称:marketplace-tests,代码行数:36,代码来源:test_reviews.py

示例12: test_that_verifies_categories_section

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:9,代码来源:test_home_page.py

示例13: test_that_verifies_featured_application_section

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    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,代码行数:10,代码来源:test_home_page.py

示例14: test_user_can_login_and_logout

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
 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,代码行数:11,代码来源:test_users_account.py

示例15: test_that_searching_returns_results

# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import go_to_homepage [as 别名]
    def test_that_searching_returns_results(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        search_page = home_page.search_for(self.search_term)

        Assert.greater(len(search_page.results), 0)

        Assert.contains(self.search_term, search_page.results[0].name)
开发者ID:viorelaioia,项目名称:marketplace-tests,代码行数:11,代码来源:test_search.py


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