summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/haketilo_test/unit/test_settings.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/test/haketilo_test/unit/test_settings.py b/test/haketilo_test/unit/test_settings.py
index 92ec4b6..6f669cb 100644
--- a/test/haketilo_test/unit/test_settings.py
+++ b/test/haketilo_test/unit/test_settings.py
@@ -81,16 +81,19 @@ def test_settings_page_tabs(driver, execute_in_page):
})
@pytest.mark.usefixtures('webextension')
@pytest.mark.parametrize('incognito', [True, False])
-def test_settings_page_indexeddb_error(driver, execute_in_page, incognito):
+def test_settings_page_error(driver, execute_in_page, incognito):
"""
- Test if failure to access IndexedDB in settings page results in the
- appropriate message being shown.
+ Test whether being in Private Browsing mode and failure to access IndexedDB
+ in settings page result in the appropriate messages being shown.
"""
+ error_divs = 'indexeddb_error', 'private_mode_error'
+
execute_in_page(
'''{
/*
* Mock an unavailable IndexedDB. Calling onerror() without having set
- * "errorCode" on the request is the behavior observed under Mozilla.
+ * "errorCode" on the request is the behavior observed under Mozilla
+ * when IndexedDB is disabled.
*/
indexedDB.open = function() {
const dummy_open_request = {};
@@ -108,11 +111,7 @@ def test_settings_page_indexeddb_error(driver, execute_in_page, incognito):
incognito)
WebDriverWait(driver, 10)\
- .until(EC.visibility_of_element_located((By.ID, 'indexeddb_error')))
+ .until(EC.visibility_of_element_located((By.ID, error_divs[incognito])))
assert driver.find_elements_by_id('loader') == []
assert not driver.find_element_by_id('main_view').is_displayed()
-
- if incognito:
- assert driver.find_element_by_id('indexeddb_private_mode_explanation')\
- .is_displayed()