Exemple #1
0
    def test_that_five_star_rating_increments(self, mozwebqa):
        """ Litmus 22920
            https://litmus.mozilla.org/show_test.cgi?id=22920 """
        # Step 1 - Login into AMO
        home_page = Home(mozwebqa)
        home_page.login()
        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.go_to_last_page()
        addon = extensions_home_page.extensions[-1]  # the last one is without rating
        addon_name = addon.name
        details_page = Details(mozwebqa, addon_name)

        # 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(5)
        write_review_block.click_to_save_review()

        # Step 6 - Ensure rating increased by one
        details_page = Details(mozwebqa, addon_name)
        new_rating_counter = details_page.get_rating_counter(5)
        Assert.equal(new_rating_counter, 1)
Exemple #2
0
    def test_that_new_review_is_saved(self, mozwebqa):
        """ Litmus 22921
            https://litmus.mozilla.org/show_test.cgi?id=22921 """
        # Step 1 - Login into AMO
        home_page = Home(mozwebqa)
        home_page.login()
        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.header.is_user_logged_in)

        # Step 2 - Load any addon detail page
        details_page = Details(mozwebqa, 'Adblock Plus')

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

        # Step 4 - Write a review
        body = 'Automatic addon review by Selenium tests'
        write_review_block.enter_review_with_text(body)
        write_review_block.set_review_rating(1)
        review_page = write_review_block.click_to_save_review()

        # Step 5 - Assert review
        review = review_page.review()
        Assert.equal(review.rating, 1)
        Assert.equal(review.author, mozwebqa.credentials['default']['name'])
        date = datetime.now().strftime("%B %d, %Y")
        # there are no leading zero-signs on day so we need to remove them too
        date = date.replace(' 0', ' ')
        Assert.equal(review.date, date)
        Assert.equal(review.text, body)
def test_duplicate_branch_name(base_url, selenium):
    """Test adding a branch with the same name as the control branch."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    experiment.fill_name("This is a test")
    experiment.fill_short_description("Testing in here")
    experiment.fill_bugzilla_url("http://bugzilla.com/show_bug.cgi?id=1234")
    exp_population = experiment.save_and_continue_btn()
    exp_population.fill_firefox_population_percentage()
    exp_population.select_firefox_channel()
    exp_population.select_firefox_min_version()
    exp_population.input_firefox_pref_name("robot rock")
    exp_population.select_firefox_pref_type()
    exp_population.select_firefox_pref_branch()
    control_branch = exp_population.current_branches[0]
    control_branch.set_branch_name("DUPLICATE BRANCH")
    control_branch.set_branch_description('THIS IS A TEST')
    control_branch.set_branch_value("false")
    extra_branch = exp_population.current_branches[-1]
    extra_branch.set_branch_name("DUPLICATE BRANCH")
    extra_branch.set_branch_description('THIS IS A TEST')
    extra_branch.set_branch_value("false")
    exp_population.click_continue()
    selenium.find_element_by_css_selector("#formset .invalid-feedback")
    def test_that_category_names_are_correct(self, mozwebqa):
        """Test for Litmus 25795"""

        expected_categories = [
            "Alerts & Updates",
            "Appearance",
            "Bookmarks",
            "Download Management",
            "Feeds, News & Blogging",
            "Games & Entertainment",
            "Language Support",
            "Photos, Music & Videos",
            "Privacy & Security",
            "Shopping",
            "Social & Communication",
            "Tabs",
            "Web Development",
            "Other"]

        # Get actual categories
        home_page = Home(mozwebqa)
        categories = home_page.categories()

        # Catch extra/missing categories with a simple count check
        Assert.equal(len(categories), len(expected_categories))

        # Check the categories that are there against the expected list
        for category in categories:
            Assert.contains(category.name, expected_categories)
    def test_create_event(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login()
        events_page = home_page.header.click_events_link()
        create_event_page = events_page.click_create_event_button()

        #Create event with all required fields
        create_event_page.set_event_name("New Event")
        create_event_page.set_event_description("Fairly long description is required")
        create_event_page.set_event_venue("Mozilla office")
        create_event_page.set_event_venue_map()
        create_event_page.set_event_city("Mountain View")
        create_event_page.select_event_country("Antarctica")
        create_event_page.select_start_month("3")
        create_event_page.select_start_day("14")
        create_event_page.select_random_start_year()
        create_event_page.select_end_month("11")
        create_event_page.select_end_day("22")
        create_event_page.select_end_year("2022")
        create_event_page.set_event_category()
        create_event_page.select_estimated_attendance("100")
        create_event_page.set_event_success_metric("10")
        create_event_page.set_event_metric("2")
        create_event_page.set_event_success_metric2("20")
        create_event_page.set_event_metric2("3")
        create_event_page.set_event_goals()

        event_detail_page = create_event_page.click_save_event_button()

        Assert.true(event_detail_page.is_event_saved_message_visible)
        Assert.equal('New Event', event_detail_page.name)
Exemple #6
0
def fill_overview(selenium, base_url, ds_issue_host, request, variables):
    """Fills overview page."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    experiment_type = getattr(request.module, "experiment_type", None)
    experiment.experiment_type = getattr(
        request.module, "experiment_type_name", "Pref-Flip Experiment"
    )
    if request.node.get_closest_marker("use_variables"):
        experiment.name = f"{variables[experiment_type]['name']}"
        experiment.short_description = "Testing in here"
        experiment.public_name = f"{variables[experiment_type]['userFacingName']}"
        experiment.public_description = (
            f"{variables[experiment_type]['userFacingDescription']}"
        )
    else:
        experiment.name = "This is a test"
        experiment.short_description = "Testing in here"
        experiment.public_name = "Public Name"
        experiment.public_description = "Public Description"
        experiment.ds_issue_url = f"{ds_issue_host}DS-12345"
    experiment.ds_issue_url = f"{ds_issue_host}DS-12345"
    experiment.save_btn()
    # Add url to object
    url = urlparse(selenium.current_url)
    experiment.url = url.path
    return experiment
Exemple #7
0
def test_duplicate_branch_name(base_url, selenium):
    """Test adding a branch with the same name as the control branch."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    experiment.name = "This is a test"
    experiment.short_description = "Testing in here"
    experiment.public_name = "Public Name"
    experiment.public_description = "Public Description"
    experiment.bugzilla_url = "http://bugzilla.com/show_bug.cgi?id=1234"
    exp_detail = experiment.save_btn()
    exp_design = exp_detail.click_edit()
    exp_design.input_firefox_pref_name("robot rock")
    exp_design.select_firefox_pref_type()
    exp_design.select_firefox_pref_branch()
    control_branch = exp_design.current_branches[0]
    control_branch.set_branch_name("DUPLICATE BRANCH")
    control_branch.set_branch_description('THIS IS A TEST')
    control_branch.set_branch_value("false")
    extra_branch = exp_design.current_branches[-1]
    extra_branch.set_branch_name("DUPLICATE BRANCH")
    extra_branch.set_branch_description('THIS IS A TEST')
    extra_branch.set_branch_value("false")
    exp_design.click_continue()
    selenium.find_element_by_css_selector("#design-form .invalid-feedback")
Exemple #8
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)
Exemple #9
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)
Exemple #10
0
 def test_the_featured_personas_section(self, mozwebqa):
     """ Test for Litmus 15392
         https://litmus.mozilla.org/show_test.cgi?id=15392"""
     home_page = Home(mozwebqa)
     personas_page = home_page.click_personas()
     Assert.true(personas_page.is_the_current_page)
     Assert.equal(6, personas_page.featured_personas_count)
    def test_hide_email_checkbox_works(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login()

        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.header.is_user_logged_in)

        view_profile_page = home_page.header.click_view_profile()
        initial_state = view_profile_page.is_email_field_present

        edit_profile_page = home_page.header.click_edit_profile()
        edit_profile_page.change_hide_email_state()
        edit_profile_page.click_update_account()

        view_profile_page = home_page.header.click_view_profile()
        final_state = view_profile_page.is_email_field_present

        try:
            Assert.not_equal(initial_state, final_state, 'The initial and final states are the same. The profile change failed.')
            if final_state is True:
                credentials = mozwebqa.credentials['default']
                Assert.equal(credentials['email'], view_profile_page.email_value, 'Actual value is not equal with the expected one.')

        except Exception as exception:
            Assert.fail(exception.msg)

        finally:
            if initial_state != final_state:
                edit_profile_page = home_page.header.click_edit_profile()
                edit_profile_page.change_hide_email_state()
                edit_profile_page.click_update_account()
                view_profile_page = home_page.header.click_view_profile()

            Assert.equal(view_profile_page.is_email_field_present, initial_state, 'Could not restore profile to initial state.')
Exemple #12
0
    def test_edit_event(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login()
        events_page = home_page.header.click_events_link()
        events_page.filter_for("New Event")
        event_detail_page = events_page.click_filtered_event()
        edit_event_page = event_detail_page.click_edit_event_button()

        #Edit newly created event
        edit_event_page.edit_event_name("Edited Event title")
        edit_event_page.edit_event_description("Updated and changed description goes here")
        edit_event_page.edit_event_venue("SFO Commons")
        edit_event_page.edit_event_city("San Francisco")
        edit_event_page.edit_event_country("United Kingdom")
        edit_event_page.edit_start_month("5")
        edit_event_page.edit_start_day("28")
        edit_event_page.select_random_start_year()
        edit_event_page.edit_end_month("12")
        edit_event_page.edit_end_day("29")
        edit_event_page.edit_event_category()
        edit_event_page.edit_estimated_attendance("400")
        edit_event_page.edit_event_success_metric("25")
        edit_event_page.edit_event_metric("2")
        edit_event_page.edit_event_success_metric2("200")
        edit_event_page.edit_event_metric2("1")
        edit_event_page.edit_event_goals()

        event_detail_page = edit_event_page.click_save_event_button()

        Assert.true(event_detail_page.is_event_saved_message_visible)
        Assert.equal('Edited Event title', event_detail_page.name)
Exemple #13
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)
    def test_login_create_account(self, driver):

        auth = Home(driver).sign_in()
        auth.write_email_create_account("testing")
        auth.click_create_account()
        auth.sleep(3)
        auth.read_error_create_account()
 def test_admin_login_logout(self, mozwebqa):
     home_page = Home(mozwebqa)
     home_page.login()
     home_page.select_org(home_page.org).click()
             
     home_page.header.click_logout()
     Assert.true(home_page.is_username_field_present)
     Assert.true(home_page.is_password_field_present)
Exemple #16
0
    def test_menu_items(self, mozwebqa):

        home = Home(mozwebqa)

        home.go_to_homepage()

        for menu_item in home.header.main_menu:
            Assert.contains(menu_item.text, self._menu_items)
Exemple #17
0
def test_related_experiments_updates_correctly(base_url, selenium):
    """Test updating related experiments."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    assert experiment.related_experiments == "Nothing selected"
    # Choose some random experiment from the list
    experiment.related_experiments = 1
    def test_create_event(self, mozwebqa):
        home = Home(mozwebqa)
        home.go_to_homepage()
        Assert.false(home.is_user_loggedin)
        home.login()
        Assert.true(home.is_user_loggedin)

        events = Events(mozwebqa)
Exemple #19
0
    def test_searching_for_collections_returns_results(self, mozwebqa):
        """Litmus 17352
        https://litmus.mozilla.org/show_test.cgi?id=17352"""
        home_page = Home(mozwebqa)
        amo_collection_page = home_page.click_collections()
        amo_search_results_page = amo_collection_page.search_for('web')

        Assert.true(amo_search_results_page.result_count > 0)
Exemple #20
0
    def test_searching_for_personas_returns_results(self, mozwebqa):
        """Litmus 17349
        https://litmus.mozilla.org/show_test.cgi?id=17349"""
        amo_home_page = Home(mozwebqa)
        amo_personas_page = amo_home_page.click_personas()
        amo_personas_page.header.search_for('fox')

        Assert.true(amo_personas_page.persona_count > 0)
Exemple #21
0
 def test_that_extensions_link_loads_extensions_page(self, mozwebqa):
     """
     Litmus 25746
     https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=25746
     """
     home_page = Home(mozwebqa)
     extensions_page = home_page.click_extensions()
     Assert.true(extensions_page.is_the_current_page)
    def test_menu_items(self, mozwebqa):

        home = Home(mozwebqa)

        home.go_to_homepage()

        for menu_item in home.header.main_menu:
            Assert.contains(menu_item.text, self._menu_items)
def test_invalid_colid_error_preview(selenium, base_url):
    # GIVEN: Selenium driver and the base url

    # WHEN: The Home page is fully loaded
    home = Home(selenium, base_url).open()

    # AND: The create a new job button is clicked
    modal = home.click_create_new_job_button()

    # AND: Clicks the Web Preview button
    modal.click_web_preview_radio_button()

    # AND: Incorrect collection id is typed into the collection id field
    modal.fill_collection_id_field("1col11229")

    # AND: Create button is clicked
    modal.click_create_button()

    split_col_id_incorrect = modal.collection_id_incorrect_field_error.text.splitlines(
    )
    text_col_id_incorrect = split_col_id_incorrect[1]

    # THEN: Correct error message appears in collection id field
    assert "A valid collection ID is required, e.g. col12345" == text_col_id_incorrect

    split_style = modal.style_field_error.text.splitlines()
    text_style = split_style[1]
    assert "Style is required" == text_style

    split_server = modal.content_server_field_error.text.splitlines()
    text_server = split_server[1]
    assert "Please select a server" == text_server

    # THEN: The modal does not close and remains open
    assert home.create_job_modal_is_open

    # WHEN: modal is open and collection id has incorrect colid/slug
    # AND: Web preview (git) button is clicked
    modal.click_web_preview_git_radio_button()

    # AND: Create button is clicked when data fields are empty and collection ID field has incorrect colid
    modal.click_create_button()

    split_col_id_slug_incorrect = (
        modal.collection_id_slug_incorrect_field_error.text.splitlines())
    text_col_id_slug_incorrect = split_col_id_slug_incorrect[1]

    # THEN: Correct error message appears in collection id and style field
    assert ("A valid repo and slug name is required, e.g. repo-name/slug-name"
            == text_col_id_slug_incorrect)

    split_style = modal.style_field_error.text.splitlines()
    text_style = split_style[1]
    assert "Style is required" == text_style

    # THEN: No error message appears for Content Server as it is disabled for web preview git
    split_server = modal.content_server_field_error.text.splitlines()
    assert "Please select a server" not in split_server
Exemple #24
0
 def test_that_clicking_mozilla_logo_loads_mozilla_dot_org(self, mozwebqa):
     """
     Litmus 22922
     https://litmus.mozilla.org/show_test.cgi?id=22922
     """
     home_page = Home(mozwebqa)
     Assert.true(home_page.is_mozilla_logo_visible)
     home_page.click_mozilla_logo()
     Assert.equal(home_page.get_url_current_page(), "http://www.mozilla.org/")
Exemple #25
0
def test_overview_engineering_owner_changes_correctly(base_url, selenium):
    """Test changing engineering owner."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    assert experiment.engineering_owner == ""
    new_owner = "uitester"
    experiment.engineering_owner = new_owner
    assert new_owner in experiment.engineering_owner
Exemple #26
0
 def test_the_most_popular_section(self, mozwebqa):
     """ Test for Litmus 15394
         https://litmus.mozilla.org/show_test.cgi?id=15394"""
     home_page = Home(mozwebqa)
     personas_page = home_page.click_personas()
     Assert.true(personas_page.is_the_current_page)
     Assert.equal(6, personas_page.most_popular_count)
     downloads = personas_page.most_popular_downloads
     Assert.is_sorted_descending(downloads)
def test_related_work_url_changes_correctly(base_url, selenium):
    """Test adding related work urls."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    assert experiment.related_work_urls == ""
    new_url = "http://someawesomeurl.com"
    experiment.related_work_urls = new_url
    assert new_url in experiment.related_work_urls
Exemple #28
0
def test_overview_type_changes_correctly(base_url, selenium):
    """Test changing experiment type."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    assert "Pref-Flip Experiment" in experiment.experiment_type
    exp_type = "Add-On Experiment"
    experiment.experiment_type = exp_type
    assert exp_type in experiment.experiment_type
Exemple #29
0
def test_feature_bugzilla_url_changes_correctly(base_url, selenium):
    """Test adding a bugzilla url."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    assert experiment.feature_bugzilla_url == ""
    new_url = "http://bugzilla.org/1234-new-url"
    experiment.feature_bugzilla_url = new_url
    assert new_url in experiment.feature_bugzilla_url
Exemple #30
0
def test_public_name_changes_correctly(base_url, selenium):
    """Test adding a public name."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    assert experiment.public_name == ""
    new_public_name = "uitested exp"
    experiment.public_name = new_public_name
    assert new_public_name in experiment.public_name
Exemple #31
0
def test_public_description_changes_correctly(base_url, selenium):
    """Test adding a public description."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    assert experiment.public_description == ""
    new_public_description = "THIS IS A LONG DESCRIPTION..!"
    experiment.public_description = new_public_description
    assert new_public_description in experiment.public_description
Exemple #32
0
def fill_overview(selenium, base_url):
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    experiment.name = "This is a test"
    experiment.short_description = "Testing in here"
    experiment.bugzilla_url = "http://bugzilla.com/show_bug.cgi?id=1234"
    experiment.analysis_owner = "*****@*****.**"
    return experiment.save_and_continue_btn()
Exemple #33
0
def test_overview_owner_changes_correctly(base_url, selenium):
    """Test changing experiment owner."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    assert home.header.current_user in experiment.experiment_owner
    owner = "admin"
    experiment.experiment_owner = owner
    assert owner in experiment.experiment_owner
Exemple #34
0
 def test_the_top_rated_section(self, mozwebqa):
     """ Test for Litmus 15395
         https://litmus.mozilla.org/show_test.cgi?id=15395"""
     home_page = Home(mozwebqa)
     personas_page = home_page.click_personas()
     Assert.true(personas_page.is_the_current_page)
     Assert.equal(6, personas_page.top_rated_count)
     ratings = personas_page.top_rated_ratings
     Assert.is_sorted_descending(ratings)
    def test_user_can_create_report(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login()

        profile_page = home_page.header.click_profile()

        if profile_page.editable_monthly_reports_present:
            edit_report_page = profile_page.click_random_editable_monthly_reports()
            fields_no = len(edit_report_page.report_fields) - 1
            random_text = "test%s" % random.choice(string.lowercase)

            # enter report values
            for i in range(0, fields_no):
                edit_report_page.report_fields[i].clear_field()
                edit_report_page.report_fields[i].type_value(random_text)

            test_link = 'http://test.com'
            edit_report_page.set_input_text_for('event_link', test_link)
            edit_report_page.set_input_text_for('activity_link', test_link)
            edit_report_page.set_input_text_for('event_name', random_text)
            edit_report_page.set_input_text_for('activity_description', random_text)
            value = '2'
            edit_report_page.select_type_of_participation(value)

            edit_report_page.click_save_report_button()

            Assert.true(edit_report_page.is_success_message_visible)
            Assert.contains('Report successfully created.', edit_report_page.success_message_text)

        else:
            edit_report_page = profile_page.click_random_existing_monthly_reports()
            edit_report_page.click_edit_report_button()
            edit_report_page.delete_report()
            Assert.true(edit_report_page.is_success_message_visible)
            Assert.contains('Report successfully deleted.', edit_report_page.success_message_text)

            profile_page.click_random_editable_monthly_reports()
            fields_no = len(edit_report_page.report_fields) - 1
            random_text = "test%s" % random.choice(string.lowercase)

            # enter report values
            for i in range(0, fields_no):
                edit_report_page.report_fields[i].clear_field()
                edit_report_page.report_fields[i].type_value(random_text)

            test_link = 'http://test.com'
            edit_report_page.set_input_text_for('event_link', test_link)
            edit_report_page.set_input_text_for('activity_link', test_link)
            edit_report_page.set_input_text_for('event_name', random_text)
            edit_report_page.set_input_text_for('activity_description', random_text)
            value = '3'
            edit_report_page.select_type_of_participation(value)

            edit_report_page.click_save_report_button()
            Assert.true(edit_report_page.is_success_message_visible)
            Assert.contains('Report successfully created.', edit_report_page.success_message_text)
Exemple #36
0
    def test_add_item_to_cart(self, driver):
        home = Home(driver)
        home.add_to_cart_home_feature_item_by_index(0)
        home.add_to_cart_home_feature_item_by_index(3)
        items = home.cart().get_cart_items()

        assert len(
            items
        ) == 2, " - Expected for two products to be Cart.    Actual: {0} products are in the Cart".format(
            len(items))
Exemple #37
0
 def test_fluxo_inicial(self, test_setup):
     """
     Método testa se é possível acessar a tela inicial do app sem erros
     :param test_setup: Conexão entre o DUT  e o Appium
     :return: boolean
     """
     home = Home(test_setup)
     home.realizar_fluxo_inicial()
     verifica_home = home.verifica_tela_home()
     assert verifica_home, 'Não acessou a tela inicial'
Exemple #38
0
def fill_overview(selenium, base_url, ds_issue_host):
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    experiment.name = "This is a test"
    experiment.short_description = "Testing in here"
    experiment.public_name = "Public Name"
    experiment.public_description = "Public Description"
    experiment.ds_issue_url = f"{ds_issue_host}DS-12345"
    return experiment
    def test_login_logout(self, mozwebqa):
        home_page = Home(mozwebqa)

        Assert.false(home_page.is_user_loggedin)
        home_page.login()
        Assert.true(home_page.is_user_loggedin)

        # log out after logging in
        home_page.click_logout_menu_item()
        Assert.false(home_page.is_user_loggedin)
Exemple #40
0
 def test_personas_breadcrumb_format(self, mozwebqa):
     """
     Verify the breadcrumb format in personas page
     https://litmus.mozilla.org/show_test.cgi?id=12034
     """
     home_page = Home(mozwebqa)
     personas_page = home_page.click_personas()
     Assert.equal(personas_page.breadcrumb_text(0), 'Add-ons for Firefox')
     Assert.equal(personas_page.breadcrumb_text(1), 'Personas')
     Assert.equal(personas_page.breadcrumb_text_all, 'Add-ons for Firefox Personas')
Exemple #41
0
def fill_overview(selenium, base_url):
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    experiment.name = "This is a test"
    experiment.short_description = "Testing in here"
    experiment.public_name = "Public Name"
    experiment.public_description = "Public Description"
    experiment.bugzilla_url = "https://jira.mozilla.com/browse/DS-123"
    return experiment
Exemple #42
0
    def test_that_clicking_see_all_personas_link_works(self, mozwebqa):
        """
        Litmus 29699
        https://litmus.mozilla.org/show_test.cgi?id=29699
        """
        home_page = Home(mozwebqa)
        featured_persona_page = home_page.click_featured_personas_see_all_link()

        Assert.true(featured_persona_page.is_the_current_page)
        Assert.equal(featured_persona_page.persona_header, 'Personas')
Exemple #43
0
 def test_start_exploring_link_in_the_promo_box(self, mozwebqa):
     """ Test for Litmus 12037
         https://litmus.mozilla.org/show_test.cgi?id=12037"""
     home_page = Home(mozwebqa)
     personas_page = home_page.click_personas()
     Assert.true(personas_page.is_the_current_page)
     Assert.true(personas_page.is_featured_addons_present)
     browse_personas_page = personas_page.click_start_exploring()
     Assert.true(browse_personas_page.is_the_current_page)
     Assert.equal("up-and-coming", browse_personas_page.sort_key)
     Assert.equal("Up & Coming", browse_personas_page.sort_by)
    def test_that_all_category_links_work(self, mozwebqa):
        "Test for Litmus 25796"
        home_page = Home(mozwebqa)
        categories = home_page.categories()

        for category in categories:
            category_name = category.name
            category_page = category.click_link()
            Assert.contains(category_name, category_page.category_page_title)
            Assert.equal(category_name, category_page.category_header_title)
            home_page = Home(mozwebqa)
Exemple #45
0
 def delete_recipe(self):
     """Delete a recipe."""
     """Returns home pages and list of notifications."""
     from pages.home import Home
     self.find_element(*self.LOCATORS.delete_button).click()
     confirm_delete = self.wait.until(
         EC.element_to_be_clickable(self.LOCATORS.confirm_delete))
     confirm_delete.click()
     messages_list = self.message_alert_helper()
     home_page = Home(self.selenium, self.base_url)
     return home_page.wait_for_page_to_load(), messages_list
 def test_dashboard_present(self, mozwebqa):
     """
     Verify dashboard page contains key elements.
     """
     home_page = Home(mozwebqa)
     home_page.login()
     home_page.select_org(home_page.org).click()
     
     dashboard = Dashboard(mozwebqa)
     Assert.true(dashboard.is_dashboard_dropbutton_present)
     Assert.true(dashboard.is_dashboard_subscriptions_present)
     Assert.true(dashboard.is_dashboard_notificaitons_present)
Exemple #47
0
 def test_cancel_button(self, test_setup):
     """
     This method tests if Cancel button returns to previous page
     :param test_setup: Connection between device under test (DUT) and Appium
     :return: boolean
     """
     home = Home(test_setup)
     home.goto_login_page()
     login = Login(test_setup)
     login.click_cancel()
     is_in_screen = login.is_in_login_screen()
     assert is_in_screen, "Did not cancel login screen"
Exemple #48
0
 def test_empty_credentials(self, test_setup):
     """
     This method checks invalid credentials when trying to login with empty credentials
     :param test_setup: Connection between device under test (DUT) and Appium
     :return: boolean
     """
     home = Home(test_setup)
     home.goto_login_page()
     login = Login(test_setup)
     login.click_login()
     message = login.get_error_message()
     assert message == constants.credentials['error_message'], "Unexpected message for wrong credentials"
Exemple #49
0
 def test_empty_username_field(self, test_setup):
     """
     This method tests if it is possible to login using username only
     :param test_setup: Connection between device under test (DUT) and Appium
     :return: boolean
     """
     home = Home(test_setup)
     home.goto_login_page()
     login = Login(test_setup)
     login.insert_password(constants.credentials['valid_password_for_valid_username'])
     login.click_login()
     message = login.get_error_message()
     assert message == constants.credentials['error_message'], "Unexpected message for wrong credentials"
Exemple #50
0
    def test_delete_event(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login()
        events_page = home_page.header.click_events_link()
        events_page.filter_for("Edited Event title")
        event_detail_page = events_page.click_filtered_event()
        edit_event_page = event_detail_page.click_edit_event_button()

        #Delete newly created event
        edit_event_page.click_delete_event_button()
        events_page = edit_event_page.click_confirm_delete_event_button()

        Assert.true(events_page.is_event_deleted_message_visible)
Exemple #51
0
 def test_that_themes_can_be_sorted_by_popularity(self, mozwebqa):
     """ test for litmus 11638 """
     home_page = Home(mozwebqa)
     themes_page = home_page.click_themes()
     themes_page.click_sort_by("popular")
     addons = themes_page.addon_names
     addons_set = set(addons)
     Assert.equal(len(addons), len(addons_set), "There are duplicates in the names")
     downloads = themes_page.addon_download_number
     Assert.is_sorted_descending(downloads)
     themes_page.page_forward()
     downloads.extend(themes_page.addon_download_number)
     Assert.is_sorted_descending(downloads)
Exemple #52
0
 def test_that_themes_can_be_sorted_by_created_date(self, mozwebqa):
     """ test for litmus 11638 """
     home_page = Home(mozwebqa)
     themes_page = home_page.click_themes()
     themes_page.click_sort_by("created")
     addons = themes_page.addon_names
     addons_set = set(addons)
     Assert.equal(len(addons), len(addons_set), "There are duplicates in the names")
     created_dates = themes_page.addon_created_dates
     Assert.is_sorted_descending(created_dates)
     themes_page.page_forward()
     created_dates.extend(themes_page.addon_created_dates)
     Assert.is_sorted_descending(created_dates)
Exemple #53
0
 def test_that_themes_categories_are_listed_on_left_hand_side(self, mozwebqa):
     """ test for litmus 15342"""
     home_page = Home(mozwebqa)
     themes_page = home_page.click_themes()
     current_page_url = home_page.get_url_current_page()
     Assert.true(current_page_url.endswith("/themes/"))
     default_categories = ["Animals", "Compact", "Large", "Miscellaneous", "Modern", "Nature", "OS Integration", "Retro", "Sports"]
     Assert.equal(themes_page.categories_count, len(default_categories))
     count = 0
     for category in default_categories:
         count += 1
         current_category = themes_page.get_category(count)
         Assert.equal(category, current_category)
Exemple #54
0
class TestSearch(BasePage):
    def setUp(self):
        super(TestSearch, self).setUp()
        self.home_page = Home(self.driver)
        self.search_page = Search(self.driver)
        #重写父类setUp方法

    @allure.story('测试首页搜索:拼多多')
    def test_add_stock(self):
        self.home_page.home_serch()
        search = self.search_page.add_stock()
        self.search_page.assert_obj_exits(None, *search.followd_btn)
        self.search_page.logger.info("股票添加成功...")
        search.clean_serach_input()
Exemple #55
0
def test_organic_flow_param_values(base_url, selenium):
    # we:
    # 1. compare the values we expect from breaking out downloadLink in derive_url()
    # 2. ...to the utm_param_values we expect to see for source, medium, campaign, and content
    page = Home(selenium, base_url).open().open_firefox()
    derived_url = page.click_download().download_link_location
    expected = {
        'source': urlparse.urlparse(base_url).hostname,
        'medium': 'referral',
        'campaign': '(not set)',
        'content': '(not set)'}
    actual = breakout_utm_param_values(derived_url)

    assert actual == expected
Exemple #56
0
def test_create_new_job_modal_form_opens_and_closes(selenium, base_url):
    # GIVEN: Selenium driver and the base url

    # WHEN: The Home page is fully loaded
    # AND: The create a new job button is clicked
    home = Home(selenium, base_url).open()
    modal = home.click_create_new_job_button()

    # THEN: The create a new job modal opens
    # AND:  The modal closes when cancel is clicked
    assert home.create_job_modal_is_open

    modal.click_cancel_button()
    assert not home.create_job_modal_is_open
Exemple #57
0
    def test_user_can_login_and_logout_using_browser_id(self, mozwebqa):
        """ Test for litmus 7857
        https://litmus.mozilla.org/show_test.cgi?id=7857
        Test for litmus 4859
        https://litmus.mozilla.org/show_test.cgi?id=4859
        """

        home_page = Home(mozwebqa)
        home_page.login("browserID")
        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.header.is_user_logged_in)

        home_page.header.click_logout()
        Assert.false(home_page.header.is_user_logged_in)
    def test_user_can_login_and_logout_using_browser_id_and_return(
            self, mozwebqa):
        """ Test for litmus 7857
        https://litmus.mozilla.org/show_test.cgi?id=7857
        Test for litmus 4859
        https://litmus.mozilla.org/show_test.cgi?id=4859
        """

        home_page = Home(mozwebqa)
        home_page.login(user="******", use_return=True)

        Assert.true(home_page.header.is_sign_out_visible)

        home_page.header.click_sign_out()
        Assert.false(home_page.header.is_sign_out_visible)
Exemple #59
0
def fill_overview(selenium, base_url, ds_issue_host, default_data):
    """Fills overview page."""
    selenium.get(base_url)
    home = Home(selenium, base_url).wait_for_page_to_load()
    experiment = home.create_experiment()
    experiment.experiment_type = default_data.type_name
    experiment.public_name = default_data.user_facing_name
    experiment.public_description = default_data.user_facing_description
    experiment.internal_description = "Testing in here"
    experiment.ds_issue_url = f"{ds_issue_host}DS-12345"
    experiment.save_btn()
    # Add url to object
    url = urlparse(selenium.current_url)
    experiment.url = url.path
    return experiment
    def test_profile_grid_is_visible(self, mozwebqa):
        home_page = Home(mozwebqa)

        people_page = home_page.header.click_people_link()
        Assert.true(people_page.is_profile_grid_visible)
        Assert.true(people_page.is_profile_name_visible)
        Assert.true(people_page.is_profile_image_visible)