diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-01-08 14:47:39 +0100 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-01-08 14:48:12 +0100 |
commit | 448820a11634de6ec356c77b8c7c0cf4937b344c (patch) | |
tree | 06147c3d40475ba863ccea9904ba4cdfe1d66db0 /test/unit/conftest.py | |
parent | 372d24ea3a52e376f953deeffeb7847d008b81c9 (diff) | |
download | browser-extension-448820a11634de6ec356c77b8c7c0cf4937b344c.tar.gz browser-extension-448820a11634de6ec356c77b8c7c0cf4937b344c.zip |
work on UI components
This commit introduces some HTML and javascript (and tests for it) to use in constructing the new UI. This is partial work that is not yet finished.
Diffstat (limited to 'test/unit/conftest.py')
-rw-r--r-- | test/unit/conftest.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/unit/conftest.py b/test/unit/conftest.py index 48e66c1..9318f6e 100644 --- a/test/unit/conftest.py +++ b/test/unit/conftest.py @@ -66,15 +66,25 @@ def webextension(driver, request): ext_data = request.node.get_closest_marker('ext_data') if ext_data is None: raise Exception('"webextension" fixture requires "ext_data" marker to be set') + ext_data = ext_data.args[0].copy() + + navigate_to = ext_data.get('navigate_to') + if navigate_to is not None: + del ext_data['navigate_to'] - ext_path = make_extension(Path(driver.firefox_profile.path), - **ext_data.args[0]) driver.get('https://gotmyowndoma.in/') + ext_path = make_extension(Path(driver.firefox_profile.path), **ext_data) addon_id = driver.install_addon(str(ext_path), temporary=True) WebDriverWait(driver, 10).until( EC.url_matches('^moz-extension://.*') ) + + if navigate_to is not None: + testpage_url = driver.execute_script('return window.location.href;') + driver.get(testpage_url.replace('testpage.html', navigate_to)) + yield + close_all_but_one_window(driver) driver.get('https://gotmyowndoma.in/') driver.uninstall_addon(addon_id) |