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