From 448820a11634de6ec356c77b8c7c0cf4937b344c Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Sat, 8 Jan 2022 14:47:39 +0100 Subject: 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. --- test/unit/conftest.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'test/unit/conftest.py') 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) -- cgit v1.2.3