def test_that_verifies_the_tooltip_for_Other_Applications(self, mozwebqa):
     """
     Litmus 22925
     https://litmus.mozilla.org/show_test.cgi?id=22925
     """
     amo_home_page = AddonsHomePage(mozwebqa)
     Assert.equal(amo_home_page.header.other_applications_tooltip, 'Find add-ons for other applications')
Example #2
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_that_events_front_page_shows_upcoming_events(self, mozwebqa):
        home_page = HomePage(mozwebqa)
        home_page.go_to_page()

        events_page = home_page.header.go_to_events_page()
        Assert.true(events_page.upcoming_events_count > 0)
        Assert.true(events_page.upcoming_events_is_visible)
Example #4
0
    def test_cant_find_what_youre_looking_for_test(self, mozwebqa, search_term):
        search_page_obj = PageProvider(mozwebqa).search_page()
        search_page_obj.do_search_on_search_box(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_creating_profile_without_checking_privacy_policy_checkbox(self, mozwebqa):
        user = self.get_new_user()

        home_page = Home(mozwebqa)

        profile = home_page.create_new_user(user)

        profile.set_full_name("User that doesn't like policy")
        profile.set_bio("Hello, I'm new here and trying stuff out. Oh, and by the way: I'm a robot, run in a cronjob, and will not check accept the privacy policy")

        skills = profile.click_next_button()
        skills.add_skill('test')
        skills.add_language('english')

        location = skills.click_next_button()
        location.select_country('us')
        location.set_state('California')
        location.set_city('Mountain View')

        location.click_create_profile_button()

        profile = ProfileTab(mozwebqa)

        Assert.equal('new error message', profile.error_message)
        location = profile.go_to_tab('location')
        Assert.equal('This field is required.', location.privacy_error_message)
Example #6
0
    def test_filter_results_by_location(self, mozwebqa):
        query = u"Greece"
        home_page = Home(mozwebqa)

        events_page = home_page.header.click_events_link()
        events_page.filter_for(query)
        Assert.contains(u"Greece", events_page.event_profile_location_text)
Example #7
0
 def test_that_clicking_on_a_subcategory_loads_expected_page(self, mozwebqa):
     """test for litmus 15949"""
     home_page = Home(mozwebqa)
     themes_page = home_page.click_themes()
     selected_category = themes_page.themes_category
     amo_category_page = themes_page.click_on_first_category()
     Assert.equal(selected_category, amo_category_page.title)
Example #8
0
 def test_sorting_by_downloads(self, mozwebqa):
     """ Litmus 17342
         https://litmus.mozilla.org/show_test.cgi?id=17342 """
     AddonsHomePage(mozwebqa).header.search_for('firebug')
     amo_search_page = AddonsSearchHomePage(mozwebqa).sort_by('downloads')
     Assert.true('sort=weeklydownloads' in amo_search_page.get_url_current_page())
     Assert.is_sorted_descending([i.downloads for i in amo_search_page.results()])
Example #9
0
 def test_sorting_by_updated_date(self, mozwebqa):
     """ Litmus 17345
         https://litmus.mozilla.org/show_test.cgi?id=17345 """
     AddonsHomePage(mozwebqa).header.search_for('firebug')
     amo_search_page = AddonsSearchHomePage(mozwebqa).sort_by('updated')
     Assert.true('sort=updated' in amo_search_page.get_url_current_page())
     Assert.is_sorted_descending([i.updated_date for i in amo_search_page.results()])
    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)
Example #11
0
 def test_the_search_field_placeholder(self, mozwebqa):
     """
     Litmus 4826
     https://litmus.mozilla.org/show_test.cgi?id=4826
     """
     amo_home_page = AddonsHomePage(mozwebqa)
     Assert.equal(amo_home_page.header.search_field_placeholder, 'search for add-ons')
    def test_that_a_screenshot_can_be_added(self, mozwebqa):
        """Test the happy path for adding a screenshot for a free submitted app.

        Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50479
        """
        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="default")
        my_apps = dev_home.header.click_my_submissions()
        edit_listing = my_apps.first_free_app.click_edit()
        before_screenshots_count = len(edit_listing.screenshots_previews)

        # bring up the media form for the first free app
        media_region = edit_listing.click_edit_media()
        screenshots_count = len(media_region.screenshots)

        # upload a new screenshot
        media_region.screenshot_upload(self._get_resource_path('img.jpg'))

        # check that the screenshot list is updated
        new_screenshots_count = len(media_region.screenshots)
        Assert.equal(screenshots_count + 1, new_screenshots_count,
                     'Expected %s screenshots, but there are %s.' % (screenshots_count + 1, new_screenshots_count))

        # save the changes
        media_region.click_save_changes()

        # check that the icon preview has been updated
        after_screenshots_count = len(edit_listing.screenshots_previews)
        Assert.equal(before_screenshots_count + 1, len(edit_listing.screenshots_previews),
                     'Expected %s screenshots, but there are %s.' % (before_screenshots_count + 1, after_screenshots_count))
    def test_that_checks_editing_support_information_for_a_free_app(self, mozwebqa):
        """
        Test edit support information for a free app.

        Pivotal task: https://www.pivotaltracker.com/story/show/27741207
        Litmus: https://litmus.mozilla.org/show_test.cgi?id=50481
        """
        updated_app = MockApplication()

        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="default")
        my_apps = dev_home.header.click_my_submissions()
        edit_listing = my_apps.first_free_app.click_edit()

        # update fields in support information
        support_info_region = edit_listing.click_support_information()
        support_info_region.type_support_email(updated_app['support_email'])
        support_info_region.type_support_url(updated_app['support_website'])

        support_info_region.click_save_changes()

        # Verify the changes have been made
        Assert.equal(edit_listing.email, updated_app['support_email'])
        Assert.equal(edit_listing.website, updated_app['support_website'])
    def test_assert_that_a_app_can_be_added_by_api(self, mozwebqa):
        mock_app = MockApplication()  # generate mock app
        mock_app.name = "API %s" % mock_app.name

        # init API client
        mk_api = MarketplaceAPI.get_client(mozwebqa.base_url, mozwebqa.credentials)

        mk_api.submit_app(mock_app)  # submit app

        app_status = mk_api.app_status(mock_app)  # get app data from API

        # Selenium
        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="default")

        dev_submissions = dev_home.header.click_my_submissions()

        dev_submissions.sorter.sort_by("created")
        apps = dev_submissions.submitted_apps

        app_names = []
        for app in apps:
            app_names.append(app.name)

        Assert.contains(app_status["name"], app_names)
Example #15
0
    def test_advanced_options_are_visible(self, mozwebqa):
        home_page = Home(mozwebqa)

        events_page = home_page.header.click_events_link()
        events_page.click_advanced_options()
        Assert.true(events_page.is_advanced_search_form_visible)
        Assert.true(events_page.is_events_icalendar_export_button_visible)
Example #16
0
    def test_that_search_results_return_20_results_per_page(self, mozwebqa):
        """
        Litmus 17346
        https://litmus.mozilla.org/show_test.cgi?id=17346
        """
        amo_home_page = AddonsHomePage(mozwebqa)
        amo_search_page = amo_home_page.header.search_for("deutsch")

        first_expected = 1
        second_expected = 20

        while(amo_search_page.is_forword_present):
            results_summary = amo_search_page.results_displayed
            results = re.split("\W+", results_summary)
            first_count = results[1]
            second_count = results[2]

            Assert.equal(str(first_expected), first_count)
            Assert.equal(str(second_expected), second_count)
            Assert.equal(amo_search_page.result_count, 20)

            amo_search_page.page_forward()
            first_expected += 20
            second_expected += 20

        number = int(re.split("\W+", results_summary)[4]) % 20

        if number == 0:
            Assert.equal(amo_search_page.result_count, 20)
        else:
            Assert.equal(amo_search_page.result_count, number)
Example #17
0
    def test_filter_results_by_owner(self, mozwebqa):
        query = u"John Giannelos"
        home_page = Home(mozwebqa)

        events_page = home_page.header.click_events_link()
        events_page.filter_for(query)
        Assert.equal(u"John Giannelos", events_page.event_profile_owner_text)
Example #18
0
 def force_wait(self, wait_time):
     try:
         time.sleep(int(wait_time))
     except TimeoutException:
         Assert.fail(TimeoutException)
     finally:
         self.selenium.implicitly_wait(self.testsetup.default_implicit_wait)
Example #19
0
 def test_that_clicking_on_theme_name_loads_its_detail_page(self, mozwebqa):
     """test for litmus 15363"""
     home_page = Home(mozwebqa)
     themes_page = home_page.click_themes()
     theme_name = themes_page.addon_name(1)
     theme_page = themes_page.click_on_first_addon()
     Assert.contains(theme_name, theme_page.addon_title)
Example #20
0
def home_page_logged_in(mozwebqa):
    from pages.login import LoginPage
    login_pg = LoginPage(mozwebqa)
    login_pg.go_to_login_page()
    home_pg = login_pg.login()
    Assert.true(home_pg.is_logged_in, "Could not determine if logged in")
    return home_pg
Example #21
0
 def test_themes_subcategory_page_breadcrumb(self, mozwebqa):
     home_page = Home(mozwebqa)
     themes_page = home_page.click_themes()
     selected_category = themes_page.themes_category
     amo_category_page = themes_page.click_on_first_category()
     expected_breadcrumb = "Add-ons for Firefox Themes %s" % selected_category
     Assert.equal(expected_breadcrumb, amo_category_page.breadcrumb)
Example #22
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_browserid_link_present(self, mozwebqa):
     home_page = Home(mozwebqa)
     home_page.login()
     profile_page = home_page.header.click_view_profile_menu_item()
     edit_profile_page = profile_page.click_edit_my_profile_button()
     account_tab = edit_profile_page.go_to_tab("account")
     Assert.true(account_tab.is_browserid_link_present)
Example #24
0
    def test_that_search_results_return_20_results_per_page(self, mozwebqa):
        """
        Test for Litmus 17346.
        https://litmus.mozilla.org/show_test.cgi?id=17346
        """
        home_page = Home(mozwebqa)
        search_page = home_page.header.search_for('deutsch')

        first_expected = 1
        second_expected = 20

        while not search_page.paginator.is_next_page_disabled:
            first_count = search_page.paginator.start_item
            second_count = search_page.paginator.end_item

            Assert.equal(first_expected, first_count)
            Assert.equal(second_expected, second_count)
            Assert.equal(search_page.result_count, 20)

            search_page.paginator.click_next_page()

            first_expected += 20
            second_expected += 20

        number = search_page.paginator.total_items % 20

        if number == 0:
            Assert.equal(search_page.result_count, 20)
        else:
            Assert.equal(search_page.result_count, number)
Example #25
0
    def test_that_one_star_rating_increments(self, mozwebqa):
        """
        Test for Litmus 22916.
        https://litmus.mozilla.org/show_test.cgi?id=22916
        """
        # Step 1 - Login into AMO
        home_page = Home(mozwebqa)
        home_page.login("browserID")
        Assert.true(home_page.header.is_user_logged_in)

        # Step 2 - Go to add-ons listing page sorted by rating
        extensions_home_page = home_page.click_to_explore('Top Rated')

        # Step 3 - Pick an addon with no reviews
        extensions_home_page.paginator.click_last_page()
        addon = extensions_home_page.extensions[-1]  # the last one is without rating
        details_page = addon.click()

        # Step 4 - Click on the "Write review" button
        write_review_block = details_page.click_to_write_review()

        # Step 5 - Add review with 1-star rating
        body = 'Automatic addon review by Selenium tests'
        write_review_block.enter_review_with_text(body)
        write_review_block.set_review_rating(1)
        view_reviews = write_review_block.click_to_save_review()

        # Step 6 - Ensure rating increased by one
        view_reviews.breadcrumbs[2].click()
        details_page = Details(mozwebqa)
        new_rating_counter = details_page.get_rating_counter(1)
        Assert.equal(new_rating_counter, 1)
Example #26
0
 def test_the_featured_personas_section(self, testsetup):
     """ Test for Litmus 15392
         https://litmus.mozilla.org/show_test.cgi?id=15392"""
     amo_home_page = AddonsHomePage(testsetup)
     amo_personas_page = amo_home_page.click_personas()
     Assert.true(amo_personas_page.is_the_current_page)
     Assert.equal(6, amo_personas_page.featured_personas_count)
Example #27
0
    def test_search_by_library_name_returns_library(self, mozwebqa):
        homepage_obj = HomePage(mozwebqa)
        loginpage_obj = LoginPage(mozwebqa)
        dashboard_obj = DashboardPage(mozwebqa)
        librarypage_obj = LibraryEditorPage(mozwebqa)
        searchpage_obj = SearchPage(mozwebqa)

        homepage_obj.go_to_home_page()
        homepage_obj.header.click_signin()
        loginpage_obj.login()

        #create a new library with the valid criteria (version not initial)
        dashboard_obj.header.click_home_logo()
        homepage_obj.click_create_lib_btn()
        librarypage_obj.type_library_version('searchable')
        librarypage_obj.click_save()
        searchterm = librarypage_obj.library_name

        librarypage_obj.header.click_home_logo()
        homepage_obj.header.click_search()

        searchpage_obj.search_until_package_exists(searchterm, searchpage_obj.library(searchterm))
        Assert.true(searchpage_obj.library(searchterm).is_displayed, '%s not found before timeout' % searchterm)

        searchpage_obj.delete_test_data()
Example #28
0
    def test_events_timeline_is_visible(self, mozwebqa):
        home_page = Home(mozwebqa)

        events_page = home_page.header.click_events_link()
        events_page.click_timeline()
        events_page.wait_for_page_to_load()
        Assert.true(events_page.is_events_timeline_visible)
Example #29
0
    def is_the_current_page(self):
        if self._page_title:
            WebDriverWait(self.selenium, 10).until(lambda s: self.selenium.title)

        Assert.equal(self.selenium.title, self._page_title,
            "Expected page title: %s. Actual page title: %s" % (self._page_title, self.selenium.title))
        return True
Example #30
0
    def test_submit_sad_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing sad feedback ' + timestamp
        url = 'http://sad.example.com/' + timestamp

        # 1. go to the feedback form
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page()

        # 2. click on sad
        feedback_pg.click_sad_feedback()

        # 3. fill out description and url
        feedback_pg.set_description(desc)
        feedback_pg.set_url(url)
        feedback_pg.click_moreinfo_next()

        # 4. fill in email address
        feedback_pg.check_email_checkbox()
        feedback_pg.set_email('foo@example.com')

        # 5. submit
        thanks_pg = feedback_pg.submit(expect_success=True)
        Assert.true(thanks_pg.is_the_current_page)

        # 6. verify
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        Assert.equal(resp.type.strip(), 'Sad')
        Assert.equal(resp.body.strip(), desc.strip())
        Assert.equal(resp.locale.strip(), 'English (US)')
        Assert.equal(resp.site.strip(), 'example.com')