本文整理汇总了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))
示例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
示例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)
示例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)
示例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'])
示例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)
示例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)
示例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'])
示例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)
示例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)
示例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'])
示例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)
示例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)
示例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
示例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)