本文整理汇总了Python中pages.desktop.page_provider.PageProvider.click_all_products方法的典型用法代码示例。如果您正苦于以下问题:Python PageProvider.click_all_products方法的具体用法?Python PageProvider.click_all_products怎么用?Python PageProvider.click_all_products使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pages.desktop.page_provider.PageProvider
的用法示例。
在下文中一共展示了PageProvider.click_all_products方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_contributor_flow_to_support_forum_post
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import click_all_products [as 别名]
def test_contributor_flow_to_support_forum_post(self, mozwebqa):
"""
Shows a contributor can start on the home page and move
all the way to answering a question in the forum.
"""
reply_text = "reply"
#1. Start on the home page
#2. Log in
#3. Use the contributor bar to go to the forums.
# The questions page should list 20 posts.
#3.1 go to the question page
questions_page = PageProvider(mozwebqa).questions_page(do_login=True)
questions_page.click_all_products()
#3.2 ensure the size of the list is 20
Assert.greater(questions_page.questions_count, 0,
'There is not at least one question displayed.')
#4. Click on a question. (URL is in the forum of /questions/[some number])
#4.1 pick up an arbitrary question and click
#4.2 check if it landed on an intended forum page
question = questions_page.questions[randrange(questions_page.questions_count)]
forum_page = question.click_question_link()
#5. Go to the thread
#6. Scroll to the bottom and click into the text field
#7. Type reply
#7.1 get the login-user name to check the author of the reply
username = forum_page.header.login_user_name
#7.2 reply the post
forum_page.post_reply(reply_text)
#7.3 check if posting a reply finishes without an error
is_reply_present = forum_page.is_reply_text_present(username, reply_text)
Assert.true(is_reply_present,
u'reply with "%s" text posted by %s is not present' % (reply_text, username))
示例2: test_contributor_flow_to_support_forum_post
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import click_all_products [as 别名]
def test_contributor_flow_to_support_forum_post(self, mozwebqa, variables):
"""
Shows a contributor can start on the home page and move
all the way to answering a question in the forum.
"""
# 1. Start on the home page
# 2. Log in
# 3. Use the contributor bar to go to the forums.
# The questions page should list 20 posts.
# 3.1 go to the question page
user = variables['users']['default']
questions_page = PageProvider(mozwebqa).questions_page(
user['username'], user['password'])
questions_page.click_all_products()
# 3.2 ensure the size of the list is 20
Assert.greater(questions_page.questions_count, 0,
'There is not at least one question displayed.')
# 4. Click on a question. (URL is in the forum of /questions/[some number])
# 4.1 pick up an arbitrary question and click
# 4.2 check if it landed on an intended forum page
question = questions_page.questions[randrange(questions_page.questions_count)]
forum_page = question.click_question_link()
# 5. Go to the thread
# 6. Scroll to the bottom and click into the text field
# 7. Type reply
# 7.1 reply the post
reply = "reply"
forum_page.post_reply(reply)
# 7.2 check if posting a reply finishes without an error
Assert.true(forum_page.is_reply_text_present(user['username'], reply),
u'reply with "%s" text posted by %s is not present' % (
reply, user['username']))
示例3: test_that_questions_problem_count_increments
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import click_all_products [as 别名]
def test_that_questions_problem_count_increments(self, mozwebqa):
"""Checks if the 'I have this problem too' counter increments"""
# Can't +1 your own question so will do it logged out
questions_page = PageProvider(mozwebqa).questions_page()
questions_page.click_all_products()
view_question_page = questions_page.click_any_question(1)
initial_count = view_question_page.problem_count
view_question_page.click_problem_too_button()
view_question_page.refresh()
post_click_count = view_question_page.problem_count
Assert.equal(initial_count + 1, post_click_count)
示例4: test_that_questions_sorts_correctly_by_filter_equal_to_unanswered
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import click_all_products [as 别名]
def test_that_questions_sorts_correctly_by_filter_equal_to_unanswered(self, mozwebqa):
"""
Goes to the /questions page,
Verifies the sort filter=unanswered works
"""
expected_sorted_text = "Unanswered"
questions_page = PageProvider(mozwebqa).questions_page()
questions_page.click_all_products()
questions_page.click_all_questions_tab()
questions_page.click_sort_by_unanswered_questions()
# if there are no questions in the list then skip the test
if not questions_page.are_questions_present:
pytest.skip("No questions present for filter=%s" % expected_sorted_text)
for question in questions_page.questions:
Assert.equal(0, question.number_of_replies)
示例5: test_that_questions_sorts_correctly_by_filter_equal_to_solved
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import click_all_products [as 别名]
def test_that_questions_sorts_correctly_by_filter_equal_to_solved(self, mozwebqa):
"""
Goes to the /questions page,
Verifies the sort filter=solved works
"""
expected_sorted_text = "SOLVED"
questions_page = PageProvider(mozwebqa).questions_page()
questions_page.click_all_products()
questions_page.click_questions_done_tab()
questions_page.click_sort_by_solved_questions()
# if there are no questions in the list then skip the test
if not questions_page.are_questions_present:
pytest.skip("No questions present for filter=%s" % expected_sorted_text)
for question in questions_page.questions:
# if solved mark is highlighted the question is really solved
Assert.true('highlighted' in question.solved_questions_filter)