From 4fab7b43573b0e21c4a06febff5c5e018d65ef2a Mon Sep 17 00:00:00 2001 From: toofar Date: Sun, 20 Oct 2024 10:27:26 +1300 Subject: [PATCH] Add clipboard permission tests There are some changes in this area in Qt6.8, so it would be good to have some test coverage. The "access permission - copy" one is broken in 6.8. Still need to raise that upstream. --- tests/end2end/features/prompts.feature | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/end2end/features/prompts.feature b/tests/end2end/features/prompts.feature index 2b65bcc56..9e1ff8443 100644 --- a/tests/end2end/features/prompts.feature +++ b/tests/end2end/features/prompts.feature @@ -159,6 +159,49 @@ Feature: Prompts And I run :click-element id button Then the javascript message "Prompt reply: null" should be logged + # Clipboard permissions + + Scenario: Clipboard - no permission - copy + Given I have a fresh instance + When I set content.javascript.clipboard to none + And I open data/prompt/clipboard.html + And I run :click-element id copy + Then the javascript message "Failed to copy text." should be logged + + Scenario: Clipboard - no permission - paste + When I set content.javascript.clipboard to none + And I open data/prompt/clipboard.html + And I run :click-element id paste + Then the javascript message "Failed to read from clipboard." should be logged + + # access permission no longer allows copy permission on 6.8 because it + # falls back to a permission prompt that we don't support + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-130599 + @qt<6.8 + Scenario: Clipboard - access permission - copy + When I set content.javascript.clipboard to access + And I open data/prompt/clipboard.html + And I run :click-element id copy + Then the javascript message "Text copied: default text" should be logged + + Scenario: Clipboard - access permission - paste + When I set content.javascript.clipboard to access + And I open data/prompt/clipboard.html + And I run :click-element id paste + Then the javascript message "Failed to read from clipboard." should be logged + + Scenario: Clipboard - full permission - copy + When I set content.javascript.clipboard to access-paste + And I open data/prompt/clipboard.html + And I run :click-element id copy + Then the javascript message "Text copied: default text" should be logged + + Scenario: Clipboard - full permission - paste + When I set content.javascript.clipboard to access-paste + And I open data/prompt/clipboard.html + And I run :click-element id paste + Then the javascript message "Text pasted: default text" should be logged + # SSL Scenario: SSL error with content.tls.certificate_errors = load-insecurely