summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2019-07-05 18:25:59 +0200
committerFlorian Bruhin <me@the-compiler.org>2019-07-05 18:25:59 +0200
commit01aea3d67cfb7b8eeb2febfc141726e082d50998 (patch)
tree2f3d7e39b0f1bdc5d31119ddc42258d7001dab7e
parentf0a762d4e9a43c3b749fd864ab8359953718eb5f (diff)
downloadqutebrowser-01aea3d67cfb7b8eeb2febfc141726e082d50998.tar.gz
qutebrowser-01aea3d67cfb7b8eeb2febfc141726e082d50998.zip
Enable QtWebEngine notification tests on >= 5.13
-rw-r--r--pytest.ini1
-rw-r--r--tests/end2end/conftest.py5
-rw-r--r--tests/end2end/features/prompts.feature16
3 files changed, 14 insertions, 8 deletions
diff --git a/pytest.ini b/pytest.ini
index 5f4211ab0..9db5502b3 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -19,6 +19,7 @@ markers =
no_ci: Tests which should not run on CI.
qtwebengine_todo: Features still missing with QtWebEngine
qtwebengine_skip: Tests not applicable with QtWebEngine
+ qtwebengine_notifications: Tests which need QtWebEngine notification support
qtwebkit_skip: Tests not applicable with QtWebKit
qtwebengine_flaky: Tests which are flaky (and currently skipped) with QtWebEngine
qtwebengine_mac_xfail: Tests which fail on macOS with QtWebEngine
diff --git a/tests/end2end/conftest.py b/tests/end2end/conftest.py
index ff4e7941b..233524c43 100644
--- a/tests/end2end/conftest.py
+++ b/tests/end2end/conftest.py
@@ -110,6 +110,7 @@ def _get_backend_tag(tag):
pytest_marks = {
'qtwebengine_todo': pytest.mark.qtwebengine_todo,
'qtwebengine_skip': pytest.mark.qtwebengine_skip,
+ 'qtwebengine_notifications': pytest.mark.qtwebengine_notifications,
'qtwebkit_skip': pytest.mark.qtwebkit_skip,
}
if not any(tag.startswith(t + ':') for t in pytest_marks):
@@ -141,6 +142,10 @@ def pytest_collection_modifyitems(config, items):
config.webengine),
('qtwebengine_skip', 'Skipped with QtWebEngine', pytest.mark.skipif,
config.webengine),
+ ('qtwebengine_notifications',
+ 'Skipped with QtWebEngine < 5.13',
+ pytest.mark.skipif,
+ config.webengine and not qtutils.version_check('5.13')),
('qtwebkit_skip', 'Skipped with QtWebKit', pytest.mark.skipif,
not config.webengine),
('qtwebengine_flaky', 'Flaky with QtWebEngine', pytest.mark.skipif,
diff --git a/tests/end2end/features/prompts.feature b/tests/end2end/features/prompts.feature
index b11a214b6..b4dd22ef7 100644
--- a/tests/end2end/features/prompts.feature
+++ b/tests/end2end/features/prompts.feature
@@ -100,7 +100,7 @@ Feature: Prompts
Then the javascript message "Alert done" should be logged
And the javascript message "notification permission granted" should be logged
- @qtwebengine_todo: Notifications are not implemented in QtWebEngine
+ @qtwebengine_notifications
Scenario: Async question interrupted by async one
When I set content.notifications to ask
And I open data/prompt/notifications.html in a new tab
@@ -115,7 +115,7 @@ Feature: Prompts
Then the javascript message "notification permission granted" should be logged
And "Added quickmark test for *" should be logged
- @qtwebengine_todo: Notifications are not implemented in QtWebEngine
+ @qtwebengine_notifications
Scenario: Async question interrupted by blocking one
When I set content.notifications to ask
And I set content.javascript.alert to true
@@ -234,21 +234,21 @@ Feature: Prompts
# Notifications
- @qtwebengine_todo: Notifications are not implemented in QtWebEngine
+ @qtwebengine_notifications
Scenario: Always rejecting notifications
When I set content.notifications to false
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
Then the javascript message "notification permission denied" should be logged
- @qtwebengine_todo: Notifications are not implemented in QtWebEngine
+ @qtwebengine_notifications
Scenario: Always accepting notifications
When I set content.notifications to true
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
Then the javascript message "notification permission granted" should be logged
- @qtwebengine_todo: Notifications are not implemented in QtWebEngine
+ @qtwebengine_notifications
Scenario: notifications with ask -> false
When I set content.notifications to ask
And I open data/prompt/notifications.html in a new tab
@@ -257,7 +257,7 @@ Feature: Prompts
And I run :prompt-accept no
Then the javascript message "notification permission denied" should be logged
- @qtwebengine_todo: Notifications are not implemented in QtWebEngine
+ @qtwebengine_notifications
Scenario: notifications with ask -> true
When I set content.notifications to ask
And I open data/prompt/notifications.html in a new tab
@@ -276,7 +276,7 @@ Feature: Prompts
And I run :leave-mode
Then the javascript message "notification permission aborted" should be logged
- @qtwebengine_todo: Notifications are not implemented in QtWebEngine
+ @qtwebengine_notifications
Scenario: answering notification after closing tab
When I set content.notifications to ask
And I open data/prompt/notifications.html in a new tab
@@ -450,7 +450,7 @@ Feature: Prompts
# https://github.com/qutebrowser/qutebrowser/issues/1249#issuecomment-175205531
# https://github.com/qutebrowser/qutebrowser/pull/2054#issuecomment-258285544
- @qtwebengine_todo: Notifications are not implemented in QtWebEngine
+ @qtwebengine_notifications
Scenario: Interrupting SSL prompt during a notification prompt
When I set content.notifications to ask
And I set content.ssl_strict to ask