def test_search_advanced_links(self, testsetup): search_page_obj = search_page.SearchPage(testsetup) refine_search_page_obj = refine_search_page.RefineSearchPage(testsetup) support_home_page_obj = support_home_page.SupportHomePage(testsetup) support_home_page_obj.go_to_support_home_page() support_home_page_obj.do_search_on_main_search_box("dfg", search_page_obj) search_page_obj.click_refine_search_link(refine_search_page_obj) assert "a=2" in refine_search_page_obj.get_url_current_page(),\ "%s not in URL: %s" % ("a=2", refine_search_page_obj.get_url_current_page)
def test_search_only_tags_dont_return_zero(self): """ Checks advanced question search with only tags to ensure nonzero result (bug 583156) """ refine_search_page_obj = refine_search_page.RefineSearchPage(self.selenium) search_terms = ["desktop"] for current_search_term in search_terms: refine_search_page_obj.go_to_refine_search_page() refine_search_page_obj.do_search_tags_on_support_questions( current_search_term, refine_search_page_obj) self.assertFalse(refine_search_page_obj.is_text_present( "Found 0 results"), "Found 0 results")
def test_search_advanced_links(self): sel = self.selenium search_page_obj = search_page.SearchPage(sel) refine_search_page_obj = refine_search_page.RefineSearchPage(sel) support_home_page_obj = support_home_page.SupportHomePage(sel) support_home_page_obj.go_to_support_home_page() support_home_page_obj.do_search_on_main_search_box( "dfg", search_page_obj) search_page_obj.click_refine_search_link(refine_search_page_obj) self.failUnless("a=2" in refine_search_page_obj.get_url_current_page(), "%s not in URL: %s" % ("a=2", sel.get_location()))
def test_search_unicode_chars(self): sel = self.selenium search_page_obj = search_page.SearchPage(sel) refine_search_page_obj = refine_search_page.RefineSearchPage(sel) search_terms = [u"benötigt"] for current_search_term in search_terms: refine_search_page_obj.go_to_refine_search_page() refine_search_page_obj.do_search_on_support_questions(current_search_term, search_page_obj) if(not(search_page_obj.is_search_available())): search_page_obj.refresh() if search_page_obj.is_result_present(): self.failUnless(sel.is_text_present(current_search_term), "%s not present in search results " %(current_search_term))
def test_no_query_adv_forum_search(self, testsetup): login_pg = login_page.LoginPage(testsetup) refine_search_pg = refine_search_page.RefineSearchPage(testsetup) login_pg.log_in_as_non_admin() refine_search_pg.go_to_refine_search_page() refine_search_pg.click(refine_search_pg.support_questions_tab) refine_search_pg.type(refine_search_pg.asked_by_box, login_pg.get_user_name_non_admin()) refine_search_pg.click_button(refine_search_pg.search_button_support, True, testsetup.timeout) assert "refine" in testsetup.selenium.get_attribute(\ "css=div#basic-search > form > input:nth-child(13)@class"),\ "refine class not found"
def test_advanced_search_checked(self, testsetup): refine_search_page_obj = refine_search_page.RefineSearchPage(testsetup) search_page_obj = search_page.SearchPage(testsetup) refine_search_page_obj.go_to_refine_search_page() assert refine_search_page_obj.is_kb_cat_checked(),\ "Default search forum is not set to Firefox" search_word = 'firefox crashes' # search kb tab refine_search_page_obj.do_search_on_knowledge_base( search_word, search_page_obj) not_found = True counter = 0 while (not_found and counter < 3): if (not (search_page_obj.is_search_available())): search_page_obj.refresh() counter += 1 else: not_found = False search_page_obj.is_the_current_page # search support questions tab refine_search_page_obj.go_to_refine_search_page() refine_search_page_obj.do_search_on_support_questions( search_word, search_page_obj) not_found = True counter = 0 while (not_found and counter < 3): if (not (search_page_obj.is_search_available())): search_page_obj.refresh() counter += 1 else: not_found = False search_page_obj.is_the_current_page # search discussion forums tab refine_search_page_obj.go_to_refine_search_page() refine_search_page_obj.do_search_on_discussion_forums( search_word, search_page_obj) not_found = True counter = 0 while (not_found and counter < 3): if (not (search_page_obj.is_search_available())): search_page_obj.refresh() counter += 1 else: not_found = False search_page_obj.is_the_current_page
def test_advanced_search_checked(self): sel = self.selenium refine_search_page_obj = refine_search_page.RefineSearchPage(sel) search_page_obj = search_page.SearchPage(sel) refine_search_page_obj.go_to_refine_search_page() self.failUnless(refine_search_page_obj.is_kb_cat_checked(), "Default search forum is not set to Firefox") search_word = 'firefox crashes' """ search kb tab """ refine_search_page_obj.do_search_on_knowledge_base( search_word, search_page_obj) not_found = True counter = 0 while (not_found and counter < 3): if (not (search_page_obj.is_search_available())): search_page_obj.refresh() counter = counter + 1 else: not_found = False search_page_obj.is_the_current_page """ search support questions tab """ refine_search_page_obj.go_to_refine_search_page() refine_search_page_obj.do_search_on_support_questions( search_word, search_page_obj) not_found = True counter = 0 while (not_found and counter < 3): if (not (search_page_obj.is_search_available())): search_page_obj.refresh() counter = counter + 1 else: not_found = False search_page_obj.is_the_current_page """ search discussion forums tab """ refine_search_page_obj.go_to_refine_search_page() refine_search_page_obj.do_search_on_discussion_forums( search_word, search_page_obj) not_found = True counter = 0 while (not_found and counter < 3): if (not (search_page_obj.is_search_available())): search_page_obj.refresh() counter = counter + 1 else: not_found = False search_page_obj.is_the_current_page