aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_settings.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-16 22:01:38 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-16 22:01:38 +0100
commitfd9f2fc4783cc606734e61116185c032a63d54a0 (patch)
treeddc162b1df608c3ae51d74f19fbffc92e5cfc3e3 /test/unit/test_settings.py
parent7965f1b455144220c137bcb25c4967283a6b7ff3 (diff)
downloadbrowser-extension-fd9f2fc4783cc606734e61116185c032a63d54a0.tar.gz
browser-extension-fd9f2fc4783cc606734e61116185c032a63d54a0.zip
fix out-of-source builds
Diffstat (limited to 'test/unit/test_settings.py')
-rw-r--r--test/unit/test_settings.py63
1 files changed, 0 insertions, 63 deletions
diff --git a/test/unit/test_settings.py b/test/unit/test_settings.py
deleted file mode 100644
index 7cdb76f..0000000
--- a/test/unit/test_settings.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# SPDX-License-Identifier: CC0-1.0
-
-"""
-Haketilo unit tests - entire settings page
-"""
-
-# This file is part of Haketilo
-#
-# Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the CC0 1.0 Universal License as published by
-# the Creative Commons Corporation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# CC0 1.0 Universal License for more details.
-
-import pytest
-from .utils import *
-
-from ..extension_crafting import ExtraHTML
-from ..script_loader import load_script
-from .utils import *
-
-@pytest.mark.ext_data({
- 'background_script': broker_js,
- 'extra_html': ExtraHTML('html/settings.html', wrap_into_htmldoc=False)
-})
-@pytest.mark.usefixtures('webextension')
-def test_settings_page_tabs(driver, execute_in_page):
- """
- Test navigation throught the tabs of the settings page.
- """
- # First, put some sample data in IndexedDB.
- execute_in_page(load_script('common/indexeddb.js'))
- execute_in_page(
- '''
- initial_data = arguments[0];
- returnval(get_db().then(() => {}));
- ''',
- make_complete_sample_data())
-
- # Now navigate to settings page.
- testpage_url = driver.execute_script('return window.location.href;')
- driver.get(testpage_url.replace('testpage.html', 'html/settings.html'))
-
- names = ['blocking', 'mappings', 'resources', 'new_payload', 'repos']
- tabs = dict([(n, driver.find_element_by_id(f'{n}_tab')) for n in names])
- heads = dict([(n, driver.find_element_by_id(f'{n}_head')) for n in names])
-
- for i, tab_name in enumerate(['new_payload', *names]):
- if (i > 0):
- heads[tab_name].click()
-
- assert 'active_head' in heads[tab_name].get_attribute('class')
- assert 'active_tab' in tabs[tab_name].get_attribute('class')
- assert tabs[tab_name].is_displayed()
- for tab_name_2 in [n for n in names if n != tab_name]:
- assert 'active_head' not in heads[tab_name_2].get_attribute('class')
- assert 'active_tab' not in tabs[tab_name_2].get_attribute('class')
- assert not tabs[tab_name_2].is_displayed()