From 59300cb71e8417070b5e3225f6b10ff7b8337393 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 5 Sep 2016 17:25:52 +0200 Subject: [PATCH] Add tests for js-can-open-windows-automatically --- tests/end2end/features/javascript.feature | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index 1d716bb95..a86d88e20 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -55,3 +55,19 @@ Feature: Javascript stuff And I run :click-element id close-twice And I wait for "Focus object changed: *" in the log Then no crash should happen + + @qtwebengine_createWindow + Scenario: Opening window without user interaction with javascript-can-open-windows-automatically set to true + When I open data/hello.txt + And I set content -> javascript-can-open-windows-automatically to true + And I run :tab-only + And I run :jseval if (window.open('about:blank')) { console.log('window opened'); } else { console.log('error while opening window'); } + Then the javascript message "window opened" should be logged + + @qtwebengine_createWindow + Scenario: Opening window without user interaction with javascript-can-open-windows-automatically set to false + When I open data/hello.txt + And I set content -> javascript-can-open-windows-automatically to false + And I run :tab-only + And I run :jseval if (window.open('about:blank')) { console.log('window opened'); } else { console.log('error while opening window'); } + Then the javascript message "error while opening window" should be logged