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)
def test_devhub_footer_copyright_message(base_url, selenium): page = DevHubHome(selenium, base_url).open().wait_for_page_to_load() assert page.footer.copyright_message.is_displayed() page.footer.noted_link.click() assert '/about/legal' in selenium.current_url page.driver.back() page.wait_for_page_to_load() page.footer.license_link.click() assert 'creativecommons.org/licenses' in selenium.current_url
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
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)
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()