summaryrefslogtreecommitdiff
path: root/test/test_integration.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-15 15:49:23 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-15 16:21:39 +0100
commit3611dd6a83bf3782bd61f413ada809b87fa599da (patch)
tree808017c3cd36b10252fd2f4257609c9d5384caf3 /test/test_integration.py
parent5ed09841865eb0c309f1501c6de15fc454478db7 (diff)
downloadbrowser-extension-3611dd6a83bf3782bd61f413ada809b87fa599da.tar.gz
browser-extension-3611dd6a83bf3782bd61f413ada809b87fa599da.zip
facilitate running test environment with Haketilo loaded into browser
Diffstat (limited to 'test/test_integration.py')
-rw-r--r--test/test_integration.py27
1 files changed, 1 insertions, 26 deletions
diff --git a/test/test_integration.py b/test/test_integration.py
index 8d8d08d..87d1827 100644
--- a/test/test_integration.py
+++ b/test/test_integration.py
@@ -18,33 +18,8 @@ Haketilo integration tests
# CC0 1.0 Universal License for more details.
import pytest
-import re
-from selenium.webdriver.support.ui import WebDriverWait
-from selenium.common.exceptions import NoSuchElementException
-
-extract_base_url_re = re.compile(r'^(.*)manifest.json$')
-
-def get_extension_base_url(driver):
- """
- Extension's internall UUID is not directly exposed in Selenium. Instead, we
- can navigate to about:debugging and inspect the manifest URL present there
- to get the base url like:
- moz-extension://b225c78f-d108-4caa-8406-f38b37d8dee5/
- which can then be used to navigate to extension-bundled pages.
- """
- driver.implicitly_wait(10)
- try:
- # For newer Firefoxes
- driver.get('about:debugging#/runtime/this-firefox')
- manifest_link = driver.find_element_by_class_name('qa-manifest-url')
- except NoSuchElementException:
- driver.get("about:debugging#addons")
- manifest_link = driver.find_element_by_class_name('manifest-url')
- driver.implicitly_wait(0)
-
- manifest_url = manifest_link.get_attribute('href')
- return extract_base_url_re.match(manifest_url).group(1)
+from .extension_crafting import get_extension_base_url
@pytest.mark.usefixtures('haketilo')
def test_integration(driver):