commit with updates and two sample add-ons file

This commit is contained in:
aschek 2023-08-07 12:07:27 +03:00
Родитель 44e987697c
Коммит 79cd923e32
7 изменённых файлов: 127 добавлений и 12 удалений

Двоичные данные
.DS_Store поставляемый Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -192,10 +192,12 @@
"ru": "Privacy Badger автоматически учится блокировать невидимые трекеры.",
"zh-CN": "隐私獾会自动学习去阻止不可见的追踪器。"
},
"addon_validation_message": "Your add-on was validated with no errors or warnings.",
"on_this_site_label_message": "On this site. Your submission is publicly listed on addons-dev.allizom.org.",
"on_your_own_label_message": "On your own. After your submission is signed by Mozilla, you can download the .xpi file from the Developer Hub and distribute it to your audience. Please make sure the add-on manifests update_url is provided, as this is the URL where Firefox finds updates for automatic deployment to your users.",
"upload_details_text": "Your add-on should end with .zip, .xpi or .crx",
"upload_status": "100% complete"
"upload_status": "100% complete",
"upload_status_results_failed": "Your add-on failed validation with 1 error.",
"unsupported_format_message": "The filetype you uploaded isn't recognized.",
"no_manifest_found_message": "manifest.json was not found"
}

Просмотреть файл

@ -29,8 +29,12 @@ class DevhubAddonValidate(Base):
_on_this_site_checkbox = (By.CSS_SELECTOR, "#id_channel_0")
_on_your_own_text_checkbox = (By.CSS_SELECTOR, "#id_channel_1")
_upload_details_text = (By.CSS_SELECTOR, ".upload-details")
_upload_status_results = (By.ID, "upload-status-results")
_upload_status_results_succes = (By.ID, "upload-status-results")
_upload_status_results_failed = (By.CSS_SELECTOR, "div.upload-status div.status-fail strong")
_upload_status_bar_results_approved = (By.CSS_SELECTOR, "div.bar-success")
_upload_status_bar_results_failed = (By.CSS_SELECTOR, "div.bar-fail")
_upload_status = (By.ID, "uploadstatus")
_upload_errors = (By.ID, "upload_errors")
def wait_for_page_to_load(self):
self.wait.until(
@ -40,7 +44,11 @@ class DevhubAddonValidate(Base):
def is_validation_approved(self):
"""Wait for addon validation to complete; if not successful, the test will fail"""
self.wait.until(EC.visibility_of_element_located(self._upload_status_results))
self.wait.until(EC.visibility_of_element_located(self._upload_status_bar_results_approved))
def is_not_validated(self):
"""Wait for addon validation to complete; if successful, the test will fail"""
self.wait.until(EC.visibility_of_element_located(self._upload_status_bar_results_failed))
@property
def addon_on_your_site(self):
@ -71,13 +79,21 @@ class DevhubAddonValidate(Base):
return self.find_element(*self._upload_details_text)
@property
def upload_details_results(self):
return self.find_element(*self._upload_status_results)
def upload_details_results_succes(self):
return self.find_element(*self._upload_status_results_succes)
@property
def upload_details_results_failed(self):
return self.find_element(*self._upload_status_results_failed)
@property
def upload_status(self):
return self.find_element(*self._upload_status)
@property
def upload_errors(self):
return self.find_element(*self._upload_errors)
def click_on_this_site_checkbox(self):
return self.find_element(*self._on_this_site_checkbox).click()

Двоичные данные
sample-addons/no_manifest_addon.zip Normal file

Двоичный файл не отображается.

Двоичные данные
sample-addons/unsupported-format-addon.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 242 KiB

Просмотреть файл

@ -30,7 +30,6 @@
"install_warning_message": "This add-on is not actively monitored for security by Mozilla. Make sure you trust it before installing.",
"addon_version_page_url": "https://addons.allizom.org/en-US/firefox/addon/devhub-listed-ext-07-30/versions/",
"addon_version_install": "worldwide-radio",
"addon_validation_message": "Your add-on was validated with no errors or warnings.",
"version_page_notice_message": "Be careful with old versions! These versions are displayed for testing and reference purposes.\nYou should always use the latest version of an add-on.",
"contribute_utm_param": "utm_content=product-page-contribute&utm_medium=referral&utm_source=addons.mozilla.org",
"contribute_card_summary": "The developer of this extension asks that you help support its continued development by making a small contribution.",
@ -196,8 +195,12 @@
"ru": "Privacy Badger автоматически учится блокировать невидимые трекеры.",
"zh-CN": "隐私獾会自动学习去阻止不可见的追踪器。"
},
"addon_validation_message": "Your add-on was validated with no errors or warnings.",
"on_this_site_label_message": "On this site. Your submission is publicly listed on addons.allizom.org.",
"on_your_own_label_message": "On your own. After your submission is signed by Mozilla, you can download the .xpi file from the Developer Hub and distribute it to your audience. Please make sure the add-on manifests update_url is provided, as this is the URL where Firefox finds updates for automatic deployment to your users.",
"upload_details_text": "Your add-on should end with .zip, .xpi or .crx",
"upload_status": "100% complete"
"upload_status": "100% complete",
"upload_status_results_failed": "Your add-on failed validation with 1 error.",
"unsupported_format_message": "The filetype you uploaded isn't recognized.",
"no_manifest_found_message": "manifest.json was not found"
}

Просмотреть файл

@ -3,7 +3,7 @@ import pytest
from pages.desktop.developers.devhub_addon_validate import DevhubAddonValidate
from pages.desktop.developers.devhub_home import DevHubHome
@pytest.mark.sanity
def test_validate_addon_listed(selenium, base_url, variables, wait):
"""Go to Devhub Home page and login as the submissions_user"""
devhub_home = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
@ -28,11 +28,11 @@ def test_validate_addon_listed(selenium, base_url, variables, wait):
devhub_addon_validate.is_validation_approved()
assert (
variables["addon_validation_message"]
in devhub_addon_validate.upload_details_results.text
in devhub_addon_validate.upload_details_results_succes.text
)
assert variables["upload_status"] in devhub_addon_validate.upload_status.text
@pytest.mark.sanity
def test_validate_addon_unlisted(selenium, base_url, variables, wait):
"""Go to Devhub Home page and login as the submissions_user"""
devhub_home = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
@ -56,6 +56,100 @@ def test_validate_addon_unlisted(selenium, base_url, variables, wait):
devhub_addon_validate.is_validation_approved()
assert (
variables["addon_validation_message"]
in devhub_addon_validate.upload_details_results.text
in devhub_addon_validate.upload_details_results_succes.text
)
assert variables["upload_status"] in devhub_addon_validate.upload_status.text
@pytest.mark.sanity
def test_validate_unlisted_addon_option_no_manifest_found(selenium, base_url, variables, wait):
"""Go to Devhub Home page and login as the submissions_user"""
devhub_home = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
devhub_home.devhub_login("developer")
"""Go to Devhub Addon Validate page"""
devhub_addon_validate = (
DevhubAddonValidate(selenium, base_url).open().wait_for_page_to_load()
)
"""Click on On Your Own Checkbox"""
devhub_addon_validate.click_on_your_own_text_checkbox()
assert devhub_addon_validate.on_your_own_text_checkbox.is_selected()
devhub_addon_validate.upload_file("no_manifest_addon.zip")
devhub_addon_validate.is_not_validated()
assert (
variables["upload_status_results_failed"]
in devhub_addon_validate.upload_details_results_failed.text
)
assert (
variables['no_manifest_found_message']
in devhub_addon_validate.upload_errors.text
)
@pytest.mark.sanity
def test_validate_listed_addon_option_no_manifest_found(selenium, base_url, variables, wait):
"""Go to Devhub Home page and login as the submissions_user"""
devhub_home = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
devhub_home.devhub_login("developer")
"""Go to Devhub Addon Validate page"""
devhub_addon_validate = (
DevhubAddonValidate(selenium, base_url).open().wait_for_page_to_load()
)
"""Click on On This Site Checkbox"""
devhub_addon_validate.click_on_this_site_checkbox()
assert devhub_addon_validate.on_this_site_checkbox.is_selected()
devhub_addon_validate.upload_file("no_manifest_addon.zip")
devhub_addon_validate.is_not_validated()
assert (
variables["upload_status_results_failed"]
in devhub_addon_validate.upload_details_results_failed.text
)
assert (
variables['no_manifest_found_message']
in devhub_addon_validate.upload_errors.text
)
@pytest.mark.sanity
def test_validate_listed_addon_option_unsupported_format(selenium, base_url, variables, wait):
"""Go to Devhub Home page and login as the submissions_user"""
devhub_home = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
devhub_home.devhub_login("developer")
"""Go to Devhub Addon Validate page"""
devhub_addon_validate = (
DevhubAddonValidate(selenium, base_url).open().wait_for_page_to_load()
)
"""Click on On This Site Checkbox"""
devhub_addon_validate.click_on_this_site_checkbox()
assert devhub_addon_validate.on_this_site_checkbox.is_selected()
devhub_addon_validate.upload_file("unsupported-format-addon.jpg")
devhub_addon_validate.is_not_validated()
assert (
variables["upload_status_results_failed"]
in devhub_addon_validate.upload_details_results_failed.text
)
assert (
variables['unsupported_format_message']
in devhub_addon_validate.upload_errors.text
)
@pytest.mark.sanity
def test_validate_unlisted_addon_option_unsupported_format(selenium, base_url, variables, wait):
"""Go to Devhub Home page and login as the submissions_user"""
devhub_home = DevHubHome(selenium, base_url).open().wait_for_page_to_load()
devhub_home.devhub_login("developer")
"""Go to Devhub Addon Validate page"""
devhub_addon_validate = (
DevhubAddonValidate(selenium, base_url).open().wait_for_page_to_load()
)
"""Click on On Your Own Checkbox"""
devhub_addon_validate.click_on_your_own_text_checkbox()
assert devhub_addon_validate.on_your_own_text_checkbox.is_selected()
devhub_addon_validate.upload_file("unsupported-format-addon.jpg")
devhub_addon_validate.is_not_validated()
assert (
variables["upload_status_results_failed"]
in devhub_addon_validate.upload_details_results_failed.text
)
assert (
variables['unsupported_format_message']
in devhub_addon_validate.upload_errors.text
)