From 7b9b08a167f64c7f8552a05cd157e3949ceb9d9d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 6 Sep 2016 15:13:43 +0200 Subject: [PATCH] QtWebEngine: Fix session tests --- tests/end2end/features/sessions.feature | 102 ++++++++++++++++++++++-- 1 file changed, 97 insertions(+), 5 deletions(-) diff --git a/tests/end2end/features/sessions.feature b/tests/end2end/features/sessions.feature index 8fdd3eba2..1fad46b69 100644 --- a/tests/end2end/features/sessions.feature +++ b/tests/end2end/features/sessions.feature @@ -20,7 +20,8 @@ Feature: Saving and loading sessions url: http://localhost:*/data/title.html title: Test title - Scenario: Zooming + @qtwebengine_skip + Scenario: Zooming (qtwebkit) When I open data/hello.txt And I run :zoom 50 Then the session should look like: @@ -32,7 +33,21 @@ Feature: Saving and loading sessions - url: http://localhost:*/data/hello.txt zoom: 0.5 - Scenario: Scrolling + # The zoom level is only stored for the newest element for QtWebEngine. + @qtwebkit_skip + Scenario: Zooming (qtwebengine) + When I open data/hello.txt + And I run :zoom 50 + Then the session should look like: + windows: + - tabs: + - history: + - url: about:blank + - url: http://localhost:*/data/hello.txt + zoom: 0.5 + + @qtwebengine_skip + Scenario: Scrolling (qtwebkit) When I open data/scroll/simple.html And I run :scroll-px 10 20 Then the session should look like: @@ -48,6 +63,21 @@ Feature: Saving and loading sessions x: 10 y: 20 + # The scroll position is only stored for the newest element for QtWebEngine. + @qtwebkit_skip + Scenario: Scrolling (qtwebengine) + When I open data/scroll/simple.html + And I run :scroll-px 10 20 + And I wait for "Scroll position changed to PyQt5.QtCore.QPoint(10, 20)" in the log + Then the session should look like: + windows: + - tabs: + - history: + - url: about:blank + - url: http://localhost:*/data/scroll/simple.html + scroll-pos: + x: 10 + y: 20 Scenario: Redirect When I open redirect-to?url=data/title.html without waiting And I wait until data/title.html is loaded @@ -71,7 +101,8 @@ Feature: Saving and loading sessions - url: http://localhost:*/data/sessions/snowman.html title: snow☃man - Scenario: Long output comparison + @qtwebengine_skip + Scenario: Long output comparison (qtwebkit) When I open data/numbers/1.txt And I open data/title.html And I open data/numbers/2.txt in a new tab @@ -121,10 +152,54 @@ Feature: Saving and loading sessions url: http://localhost:*/data/numbers/3.txt zoom: 1.0 + # FIXME:qtwebengine what's up with the titles there? + @qtwebkit_skip + Scenario: Long output comparison (qtwebengine) + When I open data/numbers/1.txt + And I open data/title.html + And I open data/numbers/2.txt in a new tab + And I open data/numbers/3.txt in a new window + # Full output apart from "geometry:" + Then the session should look like: + windows: + - active: true + tabs: + - history: + - title: about:blank + url: about:blank + - title: http://localhost:*/data/numbers/1.txt + url: http://localhost:*/data/numbers/1.txt + - active: true + scroll-pos: + x: 0 + y: 0 + title: Test title + url: http://localhost:*/data/title.html + zoom: 1.0 + - active: true + history: + - active: true + scroll-pos: + x: 0 + y: 0 + title: localhost:*/data/numbers/2.txt + url: http://localhost:*/data/numbers/2.txt + zoom: 1.0 + - tabs: + - active: true + history: + - active: true + scroll-pos: + x: 0 + y: 0 + title: localhost:*/data/numbers/3.txt + url: http://localhost:*/data/numbers/3.txt + zoom: 1.0 + # https://github.com/The-Compiler/qutebrowser/issues/879 Scenario: Saving a session with a page using history.replaceState() - When I open data/sessions/history_replace_state.html + When I open data/sessions/history_replace_state.html without waiting Then the javascript message "Calling history.replaceState" should be logged And the session should look like: windows: @@ -135,7 +210,8 @@ Feature: Saving and loading sessions url: http://localhost:*/data/sessions/history_replace_state.html?state=2 title: Test title - Scenario: Saving a session with a page using history.replaceState() and navigating away + @qtwebengine_skip + Scenario: Saving a session with a page using history.replaceState() and navigating away (qtwebkit) When I open data/sessions/history_replace_state.html And I open data/hello.txt Then the javascript message "Calling history.replaceState" should be logged @@ -151,6 +227,22 @@ Feature: Saving and loading sessions - active: true url: http://localhost:*/data/hello.txt + # Seems like that bug is fixed upstream in QtWebEngine + @qtwebkit_skip + Scenario: Saving a session with a page using history.replaceState() and navigating away + When I open data/sessions/history_replace_state.html without waiting + And I wait for "* Calling history.replaceState" in the log + And I open data/hello.txt + Then the session should look like: + windows: + - tabs: + - history: + - url: about:blank + - url: http://localhost:*/data/sessions/history_replace_state.html?state=2 + title: Test title + - active: true + url: http://localhost:*/data/hello.txt + # :session-save Scenario: Saving to a directory