本文整理汇总了Python中pages.mobile.home.Home.search_for方法的典型用法代码示例。如果您正苦于以下问题:Python Home.search_for方法的具体用法?Python Home.search_for怎么用?Python Home.search_for使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pages.mobile.home.Home
的用法示例。
在下文中一共展示了Home.search_for方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: 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 search_for [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)
示例2: test_searching_with_no_matching_results
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [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)
示例3: test_that_searching_with_empty_field_returns_results
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [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)
示例4: test_that_checks_the_addition_of_a_review
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [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'])
示例5: 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 search_for [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)
示例6: test_that_checks_the_addition_of_a_review
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [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'])
示例7: test_that_searching_returns_results
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [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)
示例8: test_that_checks_the_vote_of_an_article
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [as 别名]
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!')
示例9: test_that_searching_returns_results
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [as 别名]
def test_that_searching_returns_results(self, mozwebqa):
home_page = Home(mozwebqa)
home_page.go_to_homepage()
search_term = self._take_first_new_app_name(mozwebqa)
search_page = home_page.search_for(search_term)
Assert.greater(len(search_page.results), 0)
# Check that the results contains the search term
# Bug 1058467 - [prod] Search results are not very exact
# We change the weights of search results based on popularity. That is why you see other apps in there.
for i in range(len(search_page.results)):
if search_term == search_page.results[i].name:
Assert.equal(search_term, search_page.results[i].name)
示例10: test_that_checks_the_addition_of_a_review
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [as 别名]
def test_that_checks_the_addition_of_a_review(self, mozwebqa):
self._reviews_setup(mozwebqa)
mock_review = MockReview()
home_page = Home(mozwebqa)
home_page.go_to_homepage()
app_name = home_page.app_under_test
# Login
settings_page = home_page.header.click_settings()
settings_page.login(user='default')
settings_page.wait_for_user_email_visible()
# Search for an app and go to it's details page.
search_page = home_page.search_for(app_name)
details_page = search_page.results[0].click_app()
Assert.true(details_page.is_product_details_visible)
# Write a review
details_page.refresh_page()
review_box = details_page.click_write_review()
self.review_id = review_box.write_a_review(mock_review['rating'], mock_review['body']).review_id
Assert.equal(details_page.notification_message, "Your review was posted")
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, mozwebqa.credentials['default']['email'])
Assert.contains(review.text, mock_review['body'])
# clean up
review.delete()
reviews_page.wait_notification_box_visible()
# if clean up was successful, don't cleanup in teardown
del self.review_id
示例11: test_details_page_for_an_app
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [as 别名]
def test_details_page_for_an_app(self, mozwebqa):
"""https://moztrap.mozilla.org/runtests/run/243/env/112/ - Verify details page for an app"""
home_page = Home(mozwebqa)
home_page.go_to_homepage()
# search
search_page = home_page.search_for(self.APP_NAME)
#click first app and load its Details Page
details_page = search_page.results[0].click_app()
details_page.click_more_button()
#The verifications required by the testcase
Assert.true(details_page.header.is_back_button_visible)
Assert.true(self.APP_NAME in details_page.title)
Assert.true(details_page.is_author_visible)
Assert.true(details_page.is_app_icon_present)
Assert.true(details_page.is_rating_visible)
Assert.true(details_page.is_product_details_visible)
Assert.true(details_page.is_description_visible)
示例12: test_that_negative_search_does_not_return_results
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [as 别名]
def test_that_negative_search_does_not_return_results(self, base_url, selenium):
home = Home(base_url, selenium).open()
search_page = home.search_for("frfx")
assert 0 == len(search_page.results), "Search results found but none expected"
示例13: test_that_positive_search_returns_results
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [as 别名]
def test_that_positive_search_returns_results(self, base_url, selenium):
home = Home(base_url, selenium).open()
search_page = home.search_for("firefox")
assert len(search_page.results) > 0, "No search results found"
示例14: test_that_search_returns_results
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [as 别名]
def test_that_search_returns_results(self, mozwebqa):
home = Home(mozwebqa)
search_page = home.search_for(self.positive_search_term)
assert len(search_page.results) > 0
示例15: test_that_search_returns_results
# 需要导入模块: from pages.mobile.home import Home [as 别名]
# 或者: from pages.mobile.home.Home import search_for [as 别名]
def test_that_search_returns_results(self, base_url, selenium):
home = Home(base_url, selenium)
search_page = home.search_for(self.positive_search_term)
assert len(search_page.results) > 0