Exemple #1
0
def test_devhub_resources_write_some_code(selenium, base_url, variables):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    assert 'Write Some Code' in page.resources.write_code_section_header
    assert (variables['devhub_resources_write_some_code_text']
            in page.resources.write_code_section_info_text)
    page.resources.click_write_code_section_link()
    page.wait_for_current_url('/Add-ons/Contribute/Code')
Exemple #2
0
def test_devhub_resources_participate(selenium, base_url, variables):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    assert 'More Ways to Participate' in page.resources.participate_section_header
    assert (variables['devhub_resources_participate_text']
            in page.resources.participate_section_info_text)
    page.resources.click_participate_section_link()
    page.wait_for_current_url('/Add-ons/Contribute')
Exemple #3
0
def test_devhub_click_submit_new_theme_button(selenium, base_url, wait):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    distribution_page = page.click_submit_theme_button()
    wait.until(
        lambda _: distribution_page.submission_form_header.is_displayed(),
        message='The addon distribution page header as not displayed',
    )
Exemple #4
0
def test_devhub_resources_join_addon_review(selenium, base_url, variables):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    assert 'Review Add-ons' in page.resources.review_addons_section_header
    assert (variables['devhub_resources_review_addons_text']
            in page.resources.review_addons_section_info_text)
    page.resources.click_join_addon_review_link()
    page.wait_for_current_url('/Add-ons/Reviewers')
Exemple #5
0
def test_devhub_my_addons_section(selenium, base_url, variables):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('regular_user')
    page.wait_for_page_to_load()
    assert 'My Add-ons' in page.my_addons_section_header.text
    # if the current account has no add-ons submitted, this paragraph will be displayed
    assert (variables['devhub_my_addons_section_paragraph']
            in page.my_addons_section_paragraph.text)
Exemple #6
0
def test_devhub_click_see_all_addons_link(selenium, base_url, wait):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    my_addons_page = page.click_see_all_addons_link()
    wait.until(
        lambda _: my_addons_page.my_addons_page_title.is_displayed(),
        message='Manage addons page title was not displayed',
    )
Exemple #7
0
def test_devhub_click_my_addons_header_link(selenium, base_url, wait):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    my_addons_page = page.click_my_addons_header_link()
    # check that user is sent to the Manage addons page in devhub
    wait.until(
        lambda _: my_addons_page.my_addons_page_title.is_displayed(),
        message='My addons page title was not displayed',
    )
Exemple #8
0
def test_devhub_my_addons_list_approval_status(selenium, base_url):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    page.wait_for_page_to_load()
    count = 0
    while count < len(page.my_addons_list):
        if page.my_addons_list[count].is_listed_addon():
            # if the add-on is listed, we check that the current status is displayed in DevHub homepage
            assert page.my_addons_list[
                count].my_addon_version_status.is_displayed()
        count += 1
Exemple #9
0
def test_devhub_logged_in_page_hero_banner(selenium, base_url, variables):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    # verify the items present in the page logged in banner
    assert (variables['devhub_logged_in_banner_header']
            in page.logged_in_hero_banner_header)
    assert variables[
        'devhub_logged_in_banner_text'] in page.logged_in_hero_banner_text
    page.click_logged_in_hero_banner_extension_workshop_link()
    # verify that the Extension Workshop page is opened
    page.extension_workshop_is_loaded()
Exemple #10
0
def test_devhub_click_first_theme_button(selenium, base_url, variables):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    # an account with no add-ons submitted is used
    page.devhub_login('regular_user')
    page.wait_for_page_to_load()
    distribution_page = page.click_submit_theme_button()
    # if this user never accepted the distribution agreement, it should be displayed in the page, otherwise not
    try:
        assert (variables['devhub_submit_addon_agreement_header']
                in distribution_page.distribution_header.text)
    except AssertionError:
        assert (variables['devhub_submit_addon_distribution_header']
                in distribution_page.distribution_header.text)
Exemple #11
0
def test_devhub_resources_footer_promote_links(selenium, base_url, variables):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    assert 'Promote' in page.resources.promote_section_header
    count = 0
    # looping through the actual number of Promote links present in the resources footer
    while count in range(len(page.resources.promote_section_links)):
        link = page.resources.promote_section_links[count]
        link.click()
        # checks that the expected page is opened when clicking on the link
        page.wait_for_current_url(
            variables['devhub_resources_promote_links'][count])
        # go back to devhub and select the next Promote link
        selenium.back()
        count += 1
Exemple #12
0
def test_devhub_my_addons_list_items(selenium, base_url, wait):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    page.wait_for_page_to_load()
    # check that logged in users can see up to 3 latest addons they've submitted
    assert len(page.my_addons_list) in range(1, 4)
    for addon in page.my_addons_list:
        # verify that each addon in the list has the following items
        assert addon.my_addon_icon.is_displayed()
        assert addon.my_addon_name.is_displayed()
        assert addon.my_addon_version_number.is_displayed()
        assert addon.my_addon_last_modified_date.is_displayed()
        # checks what we display if an addon was rated (rating stars) or not (placeholder text)
        try:
            assert 'Not yet rated' in addon.my_addon_rating_text.text
        except AssertionError:
            assert 'reviews' in addon.my_addon_rating_text.text
            assert addon.my_addon_rating_stars.is_displayed()
Exemple #13
0
def test_devhub_logout(selenium, base_url, wait):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    page.click_sign_out()
    # confirms user is no longer logged in
    wait.until(lambda _: page.header_login_button.is_displayed())
Exemple #14
0
def test_devhub_login(selenium, base_url, wait):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    # verifies that the user has been logged in by looking at the user icon
    wait.until(lambda _: page.user_avatar.is_displayed())
Exemple #15
0
def test_devhub_click_header_profile_icon(selenium, base_url):
    page = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
    page.devhub_login('developer')
    user_profile = page.click_user_profile_picture()
    # verify that the user profile frontend page opens
    user_profile.wait_for_user_to_load()