def test_that_we_can_search_feedback_with_unicode(self, mozwebqa): """Litmus 13697""" feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() feedback_pg.search_for(u"p\xe1gina") Assert.greater(len(feedback_pg.messages), 0)
def test_that_promo_module_is_visible(self, mozwebqa): home_page = Home(mozwebqa) home_page.go_to_homepage() Assert.true(home_page.is_promo_box_visible) Assert.greater(home_page.promo_box_items_number, 0)
def test_that_resources_page_display_makes(self, mozwebqa): home_page = HomePage(mozwebqa) home_page.go_to_page() resources_page = home_page.header.click_teach_tab() Assert.greater(resources_page.teach_make_count, 0) Assert.true(resources_page.is_teach_makes_visible)
def test_feedback_can_be_filtered_by_locale_from_expanded_list(self, mozwebqa): """This testcase covers # 15087 & 15120 in Litmus. 1. Verify the initial locale count is 10 2. Verify clicking the more locales link shows additional locales 3. Verify filtering by one of the additional locales 4. Verify that the number of messages in the locale list matches the number of messages returned 5. Verify that the locale short code appears in the URL 6. Verify that the locale for all messages on the first page of results is correct """ feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() feedback_pg.product_filter.select_product('firefox') feedback_pg.product_filter.select_version('--') Assert.equal(len(feedback_pg.locale_filter.locales), 10) feedback_pg.locale_filter.show_more_locales() Assert.greater(len(feedback_pg.locale_filter.locales), 10) locale = feedback_pg.locale_filter.locales[10] locale_name = locale.name locale_message_count = locale.message_count locale_code = locale.code locale.select() Assert.equal(feedback_pg.total_message_count.replace(',', ''), locale_message_count) Assert.equal(feedback_pg.locale_from_url, locale_code) [Assert.equal(message.locale, locale_name) for message in feedback_pg.messages]
def test_picker_to_form_to_picker(self, mozwebqa): # Go to /feedback/, verify product picker page comes up, and # verify there are products on it picker_pg = PickerPage(mozwebqa) picker_pg.go_to_picker_page() # We can't guarantee which products are in the list or what # order they're in, so we do this goofy thing where we make # sure it's greater than one and hope "Firefox" is one of # them products = picker_pg.products Assert.greater(len(products), 0) names = [prod.name for prod in products] assert 'Firefox' in names # Pick the first product that's not "Firefox" since that's a # substring of many of the product names product = [prod for prod in picker_pg.products if prod.name != 'Firefox'][0] product_name = product.name feedback_pg = product.click() Assert.true(feedback_pg.is_the_current_page) # Verify this feedback form is for the product we chose Assert.true(feedback_pg.is_product(product_name)) # Go back to the product picker picker_pg = feedback_pg.go_to_picker_page() products = picker_pg.products Assert.greater(len(products), 0)
def test_that_promo_module_is_visible(self, mozwebqa): home_page = Home(mozwebqa) home_page.go_to_homepage() Assert.true(home_page.is_promo_box_visible) Assert.greater(home_page.promo_box_items_number, 0)
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))
def test_visitor_can_view_source(self, mozwebqa): home_pg = HomePage(mozwebqa) home_pg.go_to_home_page() view_source_pg = home_pg.header_region.click_view_source() Assert.true(view_source_pg.is_the_current_page) Assert.greater(len(view_source_pg.source_textarea.strip()), 0)
def test_feedback_can_be_filtered_by_locale_from_expanded_list( self, mozwebqa): """This testcase covers # 15087 & 15120 in Litmus. 1. Verify the initial locale count is 10 2. Verify clicking the more locales link shows additional locales 3. Verify filtering by one of the additional locales 4. Verify that the number of messages in the locale list matches the number of messages returned 5. Verify that the locale short code appears in the URL 6. Verify that the locale for all messages on the first page of results is correct """ feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() feedback_pg.product_filter.select_product('firefox') feedback_pg.product_filter.select_version('--') Assert.equal(len(feedback_pg.locale_filter.locales), 10) feedback_pg.locale_filter.show_more_locales() Assert.greater(len(feedback_pg.locale_filter.locales), 10) locale = feedback_pg.locale_filter.locales[10] locale_name = locale.name locale_message_count = locale.message_count locale_code = locale.code locale.select() Assert.equal(feedback_pg.total_message_count, locale_message_count) Assert.equal(feedback_pg.locale_from_url, locale_code) [ Assert.equal(message.locale, locale_name) for message in feedback_pg.messages ]
def create_category(self, category): uri = "api/v1/category/" post_data = {u'name': unicode(category['name'])} category['id'] = self._do_post(uri, post_data) Assert.greater(category['id'], 0, 'No category was created.')
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)
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)
def test_visitor_can_view_history(self, mozwebqa): home_pg = HomePage(mozwebqa) home_pg.go_to_home_page() history_pg = home_pg.header_region.click_history() Assert.true(history_pg.is_the_current_page) Assert.greater(len(history_pg.history_list.strip()), 0)
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']))
def test_visitor_can_view_history(self, mozwebqa): home_pg = HomePage(mozwebqa) home_pg.go_to_home_page() history_pg = home_pg.header_region.click_history() Assert.true(history_pg.is_the_current_page) Assert.greater(len(history_pg.history_list.strip()), 0)
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)
def test_that_extensions_page_contains_addons_and_the_pagination_works(self, mozwebqa): home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu("Extensions").click() # Assert that at least one addon is displayed Assert.greater(len(featured_extensions_page.extensions), 0) if len(featured_extensions_page.extensions) < 20: # Assert that the paginator is not present if fewer than 20 extensions are displayed Assert.false(featured_extensions_page.is_paginator_present) else: # Assert that the paginator is present if 20 extensions are displayed Assert.true(featured_extensions_page.is_paginator_present) Assert.true(featured_extensions_page.paginator.is_prev_page_disabled) Assert.false(featured_extensions_page.paginator.is_next_page_disabled) featured_extensions_page.paginator.click_next_page() Assert.false(featured_extensions_page.paginator.is_prev_page_disabled) Assert.false(featured_extensions_page.paginator.is_next_page_disabled) featured_extensions_page.paginator.click_prev_page() Assert.equal(len(featured_extensions_page.extensions), 20) Assert.true(featured_extensions_page.paginator.is_prev_page_disabled) Assert.false(featured_extensions_page.paginator.is_next_page_disabled)
def test_that_empty_search_of_feedback_returns_some_data(self, mozwebqa): """Litmus 13847""" feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() feedback_pg.search_for("") Assert.greater(len(feedback_pg.messages), 0)
def test_filtering_apps_by_price(self, mozwebqa, search_filter): home_page = Home(mozwebqa) home_page.go_to_homepage() Assert.true(home_page.is_the_current_page) search_page = home_page.header.search("") result_count_before_filter = search_page.results_count Assert.greater(result_count_before_filter, 0, "No results on the page") search_page.filter_by(search_filter).click() result_count_after_filter = search_page.results_count Assert.greater_equal(result_count_before_filter, result_count_after_filter) Assert.contains(search_filter, search_page.applied_filters) if search_filter == "Free Only": [ Assert.equal("FREE", result.price) for result in search_page.results ] elif search_filter == "Premium Only": for result in search_page.results: Assert.not_none(re.match("\$\d+.\d+", result.price))
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)
def test_that_carousel_works(self, mozwebqa): """ Test for Litmus 15071. https://litmus.mozilla.org/show_test.cgi?id=15071 """ discovery_pane = DiscoveryPane(mozwebqa, self.basepath(mozwebqa)) slider2 = '' #checking > button works and slides change for i in range(0, len(discovery_pane.sliders)): slider1 = discovery_pane.sliders[i].header_name Assert.not_equal(slider1, slider2) Assert.greater(discovery_pane.sliders[i].opacity_value_for_next, 0.3) discovery_pane.sliders[i].click_next() slider2 = slider1 #checking < button works and slides change for i in range(0, len(discovery_pane.sliders)): slider1 = discovery_pane.sliders[i].header_name Assert.not_equal(slider1, slider2) Assert.greater( discovery_pane.sliders[i].opacity_value_for_previous, 0.3) discovery_pane.sliders[i].click_previous() slider2 = slider1
def test_top_crasher_reports_tab_has_uuid_report(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) top_crashers = csp.click_last_product_top_crashers_link() crash_signature = top_crashers.click_first_signature() crash_signature.click_reports_tab() reports_table_count = len(crash_signature.reports) # verify crash reports table is populated Assert.greater(crash_signature.results_count_total, 0) Assert.greater(reports_table_count, 0, "No reports found") most_recent_report = crash_signature.reports[0] uuid_report = most_recent_report.click_report_date() # verify the uuid report page Assert.not_equal(uuid_report.uuid_in_body, "", "UUID not found in body") Assert.not_equal(uuid_report.uuid_in_table, "", "UUID not found in table") Assert.not_equal(uuid_report.signature_in_body, "", "Signature not found in body") Assert.not_equal(uuid_report.signature_in_table, "", "Signature not found in table") Assert.equal(uuid_report.uuid_in_body, uuid_report.uuid_in_table, 'UUID in body did not match the UUID in the table: ' 'body "%s", table "%s"' % (uuid_report.uuid_in_body, uuid_report.uuid_in_table)) Assert.contains(uuid_report.signature_in_body, uuid_report.signature_in_table, 'Signature in body did not match the signature in the ' 'table: body "%s", table "%s"' % (uuid_report.signature_in_body, uuid_report.signature_in_table))
def test_that_empty_search_of_feedback_returns_some_data(self, mozwebqa): """Litmus 13847""" feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() feedback_pg.search_for('') Assert.greater(len(feedback_pg.messages), 0)
def test_visitor_can_view_source(self, mozwebqa): home_pg = HomePage(mozwebqa) home_pg.go_to_home_page() view_source_pg = home_pg.header_region.click_view_source() Assert.true(view_source_pg.is_the_current_page) Assert.greater(len(view_source_pg.source_textarea.strip()), 0)
def test_search_pagination(self, mozwebqa): feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() # Set the date range to 2013-01-01 -> today so that we're more # likely to have so many messages in the results that it # paginates. Otherwise it might not paginate on stage or local # environments. feedback_pg.set_date_range('2013-01-01') feedback_pg.search_for(self.SEARCH_TERM) # Check the total message count. If it's less than 50 (two # pages worth), then we will fail with a helpful message. Assert.greater(feedback_pg.total_message_count, 50, "Search term didn't kick up enough messages. Please prime the server with more data!") Assert.true(feedback_pg.is_older_messages_link_visible) Assert.true(feedback_pg.is_newer_messages_link_not_visible) Assert.equal(feedback_pg.older_messages_link, 'Older Messages') feedback_pg.click_older_messages() Assert.equal(feedback_pg.search_term_from_url, self.SEARCH_TERM) Assert.true(feedback_pg.is_older_messages_link_visible) Assert.true(feedback_pg.is_newer_messages_link_visible) Assert.equal(feedback_pg.older_messages_link, 'Older Messages') Assert.equal(feedback_pg.newer_messages_link, 'Newer Messages') Assert.equal(feedback_pg.page_from_url, 2) feedback_pg.click_newer_messages() Assert.equal(feedback_pg.search_term_from_url, self.SEARCH_TERM) Assert.true(feedback_pg.is_older_messages_link_visible) Assert.true(feedback_pg.is_newer_messages_link_not_visible) Assert.equal(feedback_pg.older_messages_link, 'Older Messages') Assert.equal(feedback_pg.page_from_url, 1)
def test_the_left_panel_layout(self, mozwebqa): """This testcase covers # 13595 & 13600 in Litmus. Litmus 13595 - input:Verify the layout of the left hand side section containing various filtering options Litmus 13600 - input:Verify the applications drop down in Product """ feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() Assert.equal(feedback_pg.product_filter.selected_product, 'firefox') Assert.equal(feedback_pg.product_filter.selected_version, '7.0') Assert.false(feedback_pg.date_filter.is_date_filter_applied) Assert.false(feedback_pg.date_filter.is_custom_date_filter_visible) feedback_pg.date_filter.click_custom_dates() Assert.greater(len(feedback_pg.platform_filter.platforms), 0) Assert.equal(feedback_pg.product_filter.products, ['firefox', 'mobile']) feedback_pg.product_filter.select_version('--') types = [type.name for type in feedback_pg.type_filter.types] Assert.equal(types, ['Praise', 'Issues', 'Ideas']) platforms = [platform.name for platform in feedback_pg.platform_filter.platforms] Assert.equal(platforms, ['Windows 7', 'Windows XP', 'Windows Vista', 'Mac OS X', 'Linux']) Assert.greater(len(feedback_pg.locale_filter.locales), 0) locales = [locale.name for locale in feedback_pg.locale_filter.locales] Assert.true(set(['English (US)', 'German', 'Spanish', 'French']).issubset(set(locales)))
def test_the_middle_section_page(self, mozwebqa): """This testcase covers # 13599 & 13721 in Litmus. Litmus 13596 - input:Verify the layout of Latest Feedback section Litmus 13721 - input:Verify the layout of Feedback page (feedback tab) """ feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() Assert.equal(feedback_pg.search_box_placeholder, "Search by keyword") Assert.greater(len(feedback_pg.messages), 0) Assert.true(feedback_pg.is_chart_visible) Assert.true(feedback_pg.is_older_messages_link_enabled) Assert.false(feedback_pg.is_newer_messages_link_enabled) feedback_pg.click_older_messages() Assert.true(feedback_pg.is_older_messages_link_enabled) Assert.true(feedback_pg.is_newer_messages_link_enabled) feedback_pg.click_newer_messages() Assert.true(feedback_pg.is_older_messages_link_enabled) Assert.false(feedback_pg.is_newer_messages_link_enabled)
def test_that_extensions_page_contains_addons_and_the_pagination_works(self, mozwebqa): """ Litmus 29729 https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=29729 """ home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu("Extensions").click() # Assert that at least one addon is displayed Assert.greater(len(featured_extensions_page.extensions), 0) if len(featured_extensions_page.extensions) < 20: # Assert that the paginator is not present if fewer than 20 extensions are displayed Assert.false(featured_extensions_page.is_paginator_present) else: # Assert that the paginator is present if 20 extensions are displayed Assert.true(featured_extensions_page.is_paginator_present) Assert.true(featured_extensions_page.paginator.is_prev_page_disabled) Assert.false(featured_extensions_page.paginator.is_next_page_disabled) featured_extensions_page.paginator.click_next_page() Assert.false(featured_extensions_page.paginator.is_prev_page_disabled) Assert.false(featured_extensions_page.paginator.is_next_page_disabled) featured_extensions_page.paginator.click_prev_page() Assert.equal(len(featured_extensions_page.extensions), 20) Assert.true(featured_extensions_page.paginator.is_prev_page_disabled) Assert.false(featured_extensions_page.paginator.is_next_page_disabled)
def test_that_resources_page_display_makes(self, mozwebqa): home_page = HomePage(mozwebqa) home_page.go_to_page() resources_page = home_page.header.click_teach_tab() Assert.greater(resources_page.teach_make_count, 0) Assert.true(resources_page.is_teach_makes_visible)
def create_suite_case(self, suite, case, order): uri = "api/v1/suitecase/" post_data = {u"suite": unicode("/%s" % suite.uri), u"case": unicode("/%s" % case.uri), u"order": unicode(order)} id = self._do_post(uri, post_data) Assert.greater(id, 0, "No suite_case was created.")
def create_category(self, category): uri = "api/v1/category/" post_data = {u"name": unicode(category["name"])} category["id"] = self._do_post(uri, post_data) Assert.greater(category["id"], 0, "No category was created.")
def test_picker_to_form_to_picker(self, mozwebqa): # Go to /feedback/, verify product picker page comes up, and # verify there are products on it picker_pg = PickerPage(mozwebqa) picker_pg.go_to_picker_page() # We can't guarantee which products are in the list or what # order they're in, so we do this goofy thing where we make # sure it's greater than one and hope "Firefox" is one of # them products = picker_pg.products Assert.greater(len(products), 0) names = [prod.name for prod in products] assert 'Firefox' in names # Pick the first product that's not "Firefox" since that's a # substring of many of the product names product = [ prod for prod in picker_pg.products if prod.name != 'Firefox' ][0] product_name = product.name feedback_pg = product.click() Assert.true(feedback_pg.is_the_current_page) # Verify this feedback form is for the product we chose Assert.true(feedback_pg.is_product(product_name)) # Go back to the product picker picker_pg = feedback_pg.go_to_picker_page() products = picker_pg.products Assert.greater(len(products), 0)
def test_search_pagination(self, mozwebqa): """Litmus 13636 - Input: Verify Search results have pagination.""" feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() # Set the date range to 2013-01-01 -> today so that we're more # likely to have so many messages in the results that it # paginates. Otherwise it might not paginate on stage or local # environments. feedback_pg.set_date_range('2013-01-01') feedback_pg.search_for(self.SEARCH_TERM) # Check the total message count. If it's less than 50 (two # pages worth), then we will fail with a helpful message. Assert.greater(feedback_pg.total_message_count, 50, "Search term didn't kick up enough messages. Please prime the server with more data!") Assert.true(feedback_pg.is_older_messages_link_visible) Assert.true(feedback_pg.is_newer_messages_link_not_visible) Assert.equal(feedback_pg.older_messages_link, 'Older Messages') feedback_pg.click_older_messages() Assert.equal(feedback_pg.search_term_from_url, self.SEARCH_TERM) Assert.true(feedback_pg.is_older_messages_link_visible) Assert.true(feedback_pg.is_newer_messages_link_visible) Assert.equal(feedback_pg.older_messages_link, 'Older Messages') Assert.equal(feedback_pg.newer_messages_link, 'Newer Messages') Assert.equal(feedback_pg.page_from_url, 2) feedback_pg.click_newer_messages() Assert.equal(feedback_pg.search_term_from_url, self.SEARCH_TERM) Assert.true(feedback_pg.is_older_messages_link_visible) Assert.true(feedback_pg.is_newer_messages_link_not_visible) Assert.equal(feedback_pg.older_messages_link, 'Older Messages') Assert.equal(feedback_pg.page_from_url, 1)
def test_that_we_can_search_feedback_with_unicode(self, mozwebqa): """Litmus 13697""" feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() feedback_pg.search_for(u"p\xe1gina") Assert.greater(len(feedback_pg.messages), 0)
def test_that_extensions_page_contains_addons_and_the_pagination_works( self, mozwebqa): home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu( "Extensions").click() # Assert that at least one addon is displayed Assert.greater(len(featured_extensions_page.extensions), 0) if len(featured_extensions_page.extensions) < 20: # Assert that the paginator is not present if fewer than 20 extensions are displayed Assert.false(featured_extensions_page.is_paginator_present) else: # Assert that the paginator is present if 20 extensions are displayed Assert.true(featured_extensions_page.is_paginator_present) Assert.true( featured_extensions_page.paginator.is_prev_page_disabled) Assert.false( featured_extensions_page.paginator.is_next_page_disabled) featured_extensions_page.paginator.click_next_page() Assert.false( featured_extensions_page.paginator.is_prev_page_disabled) Assert.false( featured_extensions_page.paginator.is_next_page_disabled) featured_extensions_page.paginator.click_prev_page() Assert.equal(len(featured_extensions_page.extensions), 20) Assert.true( featured_extensions_page.paginator.is_prev_page_disabled) Assert.false( featured_extensions_page.paginator.is_next_page_disabled)
def test_that_featured_extensions_exist_on_the_home(self, mozwebqa): home_page = Home(mozwebqa) Assert.equal(home_page.featured_extensions_title, 'Featured Extensions', 'Featured Extensions region title doesn\'t match') Assert.equal(home_page.featured_extensions_see_all, u'See all \xbb', 'Featured Extensions region see all link is not correct') Assert.greater(home_page.featured_extensions_count, 1)
def test_that_search_returns_results(self, mozwebqa): feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() feedback_pg.search_for(self.positive_search_term) Assert.equal(self.positive_search_term, feedback_pg.search_term_from_url) Assert.greater(len(feedback_pg.messages), 0)
def test_that_searching_with_numerals_returns_results(self, mozwebqa): """Litmus 17347 https://litmus.mozilla.org/show_test.cgi?id=17347""" home_page = Home(mozwebqa) search_page = home_page.header.search_for('1') Assert.greater(search_page.result_count, 0) Assert.true(int(search_page.number_of_results_text.split()[0]) > 0)
def test_search_tag(self, mozwebqa): community_page = CommunityPage(mozwebqa) community_page.go_to_community_page() tag_results_page = community_page.click_first_tag_link Assert.contains('Posts and pages tagged', tag_results_page.page_title) Assert.greater(len(tag_results_page.results), 0)
def test_that_extensions_are_sorted_by_up_and_coming(self, mozwebqa): home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu("Extensions").click() featured_extensions_page.sorter.sort_by('up and coming') Assert.equal(featured_extensions_page.sorter.sorted_by, "Up & Coming") Assert.contains("sort=hotness", featured_extensions_page.get_url_current_page()) Assert.greater(len(featured_extensions_page.extensions), 0)
def test_that_accessing_author_profile_works(self, mozwebqa): author_name = "rbillings" author_page = AuthorPage(mozwebqa, author_name) author_page.go_to_author_page() Assert.true(author_page.is_the_current_page) Assert.greater(len(author_page.posted_by), 0)
def test_sort_by_price_descending_should_succeed(self): home_page = HomePage(self.driver).open_home_page() TV_page = home_page.header.open_TV_page() TV_page.sort_by_price_descending() sleep(2) WebDriverWait(self.driver, 30).until(EC.invisibility_of_element_located(TV_page._processing_info)) Assert.greater(TV_page.text_price_second_product(), TV_page.text_price_first_product())
def test_are_previous_challenges_visible(self, mozwebqa): derby_page = DerbyPage(mozwebqa) derby_page.go_to_page() derby_page.click_previous_challenges_link() Assert.greater(len(derby_page.previous_challenges), 0) for challenge in derby_page.previous_challenges: Assert.true(challenge.is_name_visible)
def test_that_links_in_the_events_page_return_200_code(self, mozwebqa): crawler = LinkCrawler(mozwebqa) urls = crawler.collect_links("/events/") Assert.greater(len(urls), 0, "The link crawler did not find any urls to crawl") all_ok, bad_urls = crawler.verify_status_codes_are_ok(urls) Assert.true(all_ok, "%s bad links found. " % len(bad_urls) + ", ".join(bad_urls))
def test_are_previous_challenges_visible(self, mozwebqa): derby_page = DerbyPage(mozwebqa) derby_page.go_to_page() derby_page.click_previous_challenges_link() Assert.greater(len(derby_page.previous_challenges), 0) for challenge in derby_page.previous_challenges: Assert.true(challenge.is_name_visible)
def test_that_verifies_categories_menu(self, mozwebqa): home_page = Home(mozwebqa) home_page.go_to_homepage() Assert.equal(home_page.categories.title, 'Categories') home_page.open_categories_menu() Assert.greater(len(home_page.categories.items), 0)
def test_that_searching_with_numerals_returns_results(self, mozwebqa): """ Test for Litmus 17347. https://litmus.mozilla.org/show_test.cgi?id=17347 """ search_page = Home(mozwebqa).header.search_for('1') Assert.greater(search_page.result_count, 0) Assert.true(int(search_page.number_of_results_text.split()[0]) > 0)
def test_that_links_in_the_labs_page_return_200_code(self, mozwebqa): crawler = LinkCrawler(mozwebqa) urls = crawler.collect_links('/labs/') Assert.greater(len(urls), 0, 'The link crawler did not find any urls to crawl') all_ok, bad_urls = crawler.verify_status_codes_are_ok(urls) Assert.true(all_ok, '%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls))
def test_that_search_returns_results(self, mozwebqa): feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() feedback_pg.search_for(self.positive_search_term) Assert.equal(self.positive_search_term, feedback_pg.search_term_from_url) Assert.greater(len(feedback_pg.messages), 0)
def test_that_searching_for_a_tag_returns_results(self, mozwebqa): home_page = Home(mozwebqa) search_page = home_page.search_for('development') result_count = search_page.filter.results_count Assert.greater(result_count, 0) search_page.filter.tag('development').click_tag() Assert.greater_equal(result_count, search_page.filter.results_count)
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)
def test_that_search_results_contain_search_text(self, mozwebqa): feedback_pg = FeedbackPage(mozwebqa) feedback_pg.go_to_feedback_page() feedback_pg.search_for(self.positive_search_term) Assert.greater(len(feedback_pg.messages), 0) for message in feedback_pg.messages: Assert.contains(self.positive_search_term, message.body.lower())
def create_category(self, category): uri = "api/v1/category/" post_data = { u'name': unicode(category['name']) } category['id'] = self._do_post(uri, post_data) Assert.greater(category['id'], 0, 'No category was created.')
def test_that_featured_extensions_exist_on_the_home(self, mozwebqa): """ Test for Litmus 25800. https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=25800 """ home_page = Home(mozwebqa) Assert.equal(home_page.featured_extensions_title, 'Featured Extensions', 'Featured Extensions region title doesn\'t match') Assert.equal(home_page.featured_extensions_see_all, u'See all \xbb', 'Featured Extensions region see all link is not correct') Assert.greater(home_page.featured_extensions_count, 1)
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)
def test_db_connection(db_session): """Test that the pgsql db is listening externally This looks for a row in the miq_databases table, which should always exist on an appliance with a working database and UI """ databases = db_session.query(db.MiqDatabase).all() Assert.greater(len(databases), 0)
def test_judge_photos_visible(self, mozwebqa): derby_page = DerbyPage(mozwebqa) derby_page.go_to_page() derby_page.click_judging_link() all_judges = derby_page.current_judges + derby_page.past_judges Assert.greater(len(all_judges), 0) for judge in all_judges: Assert.true(judge.is_photo_visible)
def test_that_verifies_categories_menu(self, mozwebqa): home_page = Home(mozwebqa) home_page.go_to_homepage() Assert.true(home_page.is_nav_menu_visible) home_page.open_categories_menu() Assert.true(home_page.is_category_section_visible) Assert.greater(len(home_page.categories), 0)