From 093ec2a52697afdda610dde1302a59183719ac0f Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 8 Mar 2022 17:34:37 +0100 Subject: correct the Private Browsing mode notice on settings page --- test/haketilo_test/unit/test_settings.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'test') 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() -- cgit v1.2.3