def test_cant_find_what_youre_looking_for_test(self, mozwebqa): search_page_obj = SearchPage(mozwebqa) searchTerms = ["firefox", "bgkhdsaghb"] for current_search_term in searchTerms: search_page_obj.go_to_search_page() search_page_obj.do_search_on_search_box(current_search_term) expected_text = "Can't find what you're looking for?" Assert.contains(expected_text, search_page_obj.ask_a_question_text) Assert.true(search_page_obj.is_ask_a_question_present, "Ask question link not present")
def test_user_flow_to_forum_post(self, mozwebqa): if mozwebqa.base_url == 'https://support-dev.allizom.org': pytest.skip( 'Search results are not guaranteed to exist on support-dev.allizom.org' ) # 1. start on the home page PageProvider(mozwebqa).home_page() # 2. type "Firefox crashed" # 3. hit Enter search_pg = SearchPage(mozwebqa) search_pg.do_search_on_search_query(self.forum_search_term + "ed") # 4. In the results list there are two types of results: # Forum and KB. Click on a forum result. # (Url is in the forum of /questions/[some number]) # 5. A complete forum thread should be displayed. Assert.true(search_pg.is_result_present, "result page is not present.") result_thread_title = search_pg.result_question_text() Assert.contains(self.forum_search_term, result_thread_title) is_reached_right_page = search_pg.click_question_link( self.forum_search_term) Assert.true(is_reached_right_page, "a form thread page is not displayed.")
def test_user_flow_to_forum_post(self, base_url, selenium): if base_url == 'https://support-dev.allizom.org': pytest.skip( 'Search results are not guaranteed to exist on support-dev.allizom.org' ) # 1. start on the home page SupportHomePage(base_url, selenium).open() # 2. type "Firefox crashed" # 3. hit Enter search_pg = SearchPage(base_url, selenium).open() # FIXME: This is searching from the search page instead of the home page. search_pg.do_search_on_search_query(self.forum_search_term + "ed") # 4. In the results list there are two types of results: # Forum and KB. Click on a forum result. # (Url is in the forum of /questions/[some number]) # 5. A complete forum thread should be displayed. assert search_pg.is_result_present, "result page is not present." result_thread_title = search_pg.result_question_text() assert self.forum_search_term in result_thread_title is_reached_right_page = search_pg.click_question_link( self.forum_search_term) assert is_reached_right_page, "a form thread page is not displayed."
def test_user_flow_to_forum_post(self, mozwebqa): if mozwebqa.base_url == 'https://support-dev.allizom.org': pytest.skip('Search results are not guaranteed to exist on support-dev.allizom.org') # 1. start on the home page PageProvider(mozwebqa).home_page() # 2. type "Firefox crashed" # 3. hit Enter search_pg = SearchPage(mozwebqa) search_pg.do_search_on_search_query(self.forum_search_term + "ed") # 4. In the results list there are two types of results: # Forum and KB. Click on a forum result. # (Url is in the forum of /questions/[some number]) # 5. A complete forum thread should be displayed. Assert.true(search_pg.is_result_present, "result page is not present.") result_thread_title = search_pg.result_question_text() Assert.contains(self.forum_search_term, result_thread_title) is_reached_right_page = search_pg.click_question_link(self.forum_search_term) Assert.true(is_reached_right_page, "a form thread page is not displayed.")
def test_user_flow_to_forum_post(self, base_url, selenium): if base_url == 'https://support-dev.allizom.org': pytest.skip('Search results are not guaranteed to exist on support-dev.allizom.org') # 1. start on the home page SupportHomePage(base_url, selenium).open() # 2. type "Firefox crashed" # 3. hit Enter search_pg = SearchPage(base_url, selenium).open() # FIXME: This is searching from the search page instead of the home page. search_pg.do_search_on_search_query(self.forum_search_term + "ed") # 4. In the results list there are two types of results: # Forum and KB. Click on a forum result. # (Url is in the forum of /questions/[some number]) # 5. A complete forum thread should be displayed. assert search_pg.is_result_present, "result page is not present." result_thread_title = search_pg.result_question_text() assert self.forum_search_term in result_thread_title is_reached_right_page = search_pg.click_question_link(self.forum_search_term) assert is_reached_right_page, "a form thread page is not displayed."
def search_page(self, do_login=False, user='******'): from pages.desktop.search_page import SearchPage return self._go_to_page(SearchPage(self.testsetup), do_login, user)
def search_page(self, username=None, password=None): from pages.desktop.search_page import SearchPage return self._go_to_page(SearchPage(self.testsetup), username, password)