2016-01-20 21:24:51 +01:00
|
|
|
Feature: Javascript stuff
|
|
|
|
|
|
|
|
Integration with javascript.
|
|
|
|
|
2016-07-13 10:25:21 +02:00
|
|
|
Scenario: Using console.log
|
|
|
|
When I set general -> log-javascript-console to debug
|
|
|
|
And I open data/javascript/consolelog.html
|
|
|
|
Then the javascript message "console.log works!" should be logged
|
|
|
|
|
2016-09-05 14:34:52 +02:00
|
|
|
# Causes segfaults...
|
2016-09-05 14:45:34 +02:00
|
|
|
@qtwebengine_createWindow
|
2016-09-05 14:34:52 +02:00
|
|
|
Scenario: Opening/Closing a window via JS
|
|
|
|
When I open data/javascript/window_open.html
|
|
|
|
And I run :tab-only
|
|
|
|
And I run :click-element id open-normal
|
|
|
|
And I wait for "Changing title for idx 1 to 'about:blank'" in the log
|
|
|
|
And I run :tab-focus 1
|
|
|
|
And I run :click-element id close-normal
|
|
|
|
Then "Focus object changed: *" should be logged
|
|
|
|
|
|
|
|
# Causes segfaults...
|
2016-09-05 14:45:34 +02:00
|
|
|
@qtwebengine_createWindow
|
2016-09-05 14:34:52 +02:00
|
|
|
Scenario: Opening/closing a modal window via JS
|
|
|
|
When I open data/javascript/window_open.html
|
|
|
|
And I run :tab-only
|
|
|
|
And I run :click-element id open-modal
|
|
|
|
And I wait for "Changing title for idx 1 to 'about:blank'" in the log
|
|
|
|
And I run :tab-focus 1
|
|
|
|
And I run :click-element id close-normal
|
|
|
|
Then "Focus object changed: *" should be logged
|
2016-09-05 14:45:34 +02:00
|
|
|
# WebModalDialog with QtWebKit, WebDialog with QtWebEngine
|
|
|
|
And "Web*Dialog requested, but we don't support that!" should be logged
|
2016-09-05 14:34:52 +02:00
|
|
|
|
2016-01-20 21:24:51 +01:00
|
|
|
# https://github.com/The-Compiler/qutebrowser/issues/906
|
|
|
|
|
2016-09-05 10:54:28 +02:00
|
|
|
@qtwebengine_skip
|
|
|
|
Scenario: Closing a JS window twice (issue 906) - qtwebkit
|
2016-01-20 21:24:51 +01:00
|
|
|
When I open about:blank
|
2016-09-05 14:34:52 +02:00
|
|
|
And I run :tab-only
|
2016-09-05 14:41:05 +02:00
|
|
|
When I open data/javascript/window_open.html in a new tab
|
|
|
|
And I run :click-element id open-normal
|
2016-01-24 18:43:07 +01:00
|
|
|
And I wait for "Changing title for idx 2 to 'about:blank'" in the log
|
2016-01-20 21:24:51 +01:00
|
|
|
And I run :tab-focus 2
|
2016-09-05 14:41:05 +02:00
|
|
|
And I run :click-element id close-twice
|
2016-01-20 21:24:51 +01:00
|
|
|
Then "Requested to close * which does not exist!" should be logged
|
2016-09-05 15:53:31 +02:00
|
|
|
|
|
|
|
@qtwebengine_createWindow @qtwebkit_skip
|
|
|
|
Scenario: Closing a JS window twice (issue 906) - qtwebengine
|
|
|
|
When I open about:blank
|
|
|
|
And I run :tab-only
|
|
|
|
And I open data/javascript/window_open.html in a new tab
|
|
|
|
And I run :click-element id open-normal
|
|
|
|
And I wait for "Changing title for idx 2 to 'about:blank'" in the log
|
|
|
|
And I run :tab-focus 2
|
|
|
|
And I run :click-element id close-twice
|
|
|
|
And I wait for "Focus object changed: *" in the log
|
|
|
|
Then no crash should happen
|
2016-09-05 17:25:52 +02:00
|
|
|
|
|
|
|
@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
|
2016-10-21 00:31:02 +02:00
|
|
|
|
|
|
|
Scenario: Executing jseval when javascript is disabled
|
|
|
|
When I set content -> allow-javascript to false
|
|
|
|
And I run :jseval console.log('jseval executed')
|
|
|
|
Then the javascript message "jseval executed" should be logged
|