diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index ccf4534dd..fb992fc63 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -636,6 +636,34 @@ def test_cookies_store(quteproc_new, request, short_tmpdir, store): quteproc_new.wait_for_quit() +@pytest.mark.qt68_beta4_skip +def test_permission_prompt_across_restart(quteproc_new, request, short_tmpdir): + # Start test process + args = _base_args(request.config) + [ + '--basedir', str(short_tmpdir), + '-s', 'content.notifications.enabled', 'ask', + ] + quteproc_new.start(args) + + def notification_prompt(answer): + quteproc_new.open_path('data/prompt/notifications.html') + quteproc_new.send_cmd(':click-element id button') + quteproc_new.wait_for(message='Asking question *') + quteproc_new.send_cmd(f':prompt-accept {answer}') + + # Make sure we are prompted the first time we are opened in this basedir + notification_prompt('yes') + quteproc_new.wait_for_js('notification permission granted') + + # Restart with same basedir + quteproc_new.send_cmd(':quit') + quteproc_new.wait_for_quit() + quteproc_new.start(args) + + # We should be re-prompted in the new instance + notification_prompt('no') + + # The 'colors' dictionaries in the parametrize decorator below have (QtWebEngine # version, CPU architecture) as keys. Either of those (or both) can be None to # say "on all other Qt versions" or "on all other CPU architectures".