aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_basic.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/test_basic.py b/test/unit/test_basic.py
index 2564e9d..612fe06 100644
--- a/test/unit/test_basic.py
+++ b/test/unit/test_basic.py
@@ -20,6 +20,7 @@ Haketilo unit tests - base
import pytest
from ..script_loader import load_script
+from ..extension_crafting import ExtraHTML
def test_driver(driver):
"""
@@ -55,3 +56,25 @@ def test_webextension(driver):
'return document.getElementsByTagName("h1")[0].innerText;'
)
assert "Extension's options page for testing" in heading
+
+@pytest.mark.ext_data({
+ 'extra_html': [
+ ExtraHTML(
+ 'html/default_blocking_policy.html',
+ {
+ 'html/default_blocking_policy.js':
+ 'document.body.innerHTML = `ski-ba-bop-ba ${typeof by_id}`;'
+ }
+ )
+ ]
+})
+@pytest.mark.usefixtures('webextension')
+def test_extra_html(driver):
+ """
+ A trivial test case of the facility for loading the Haketilo's HTML files
+ into test WebExtension for unit-testing.
+ """
+ driver.get(driver.execute_script('return window.location.href;')
+ .replace('testpage.html', 'html/default_blocking_policy.html'))
+ assert driver.execute_script('return document.body.innerText') == \
+ 'ski-ba-bop-ba function'