From 596ed5f545ecd165a31e3785bfaea2fd7d9451fa Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 10 Nov 2015 07:35:52 +0100 Subject: [PATCH] bdd: Add some more back/forward tests. --- .../integration/features/backforward.feature | 85 +++++++++++++++++-- 1 file changed, 77 insertions(+), 8 deletions(-) diff --git a/tests/integration/features/backforward.feature b/tests/integration/features/backforward.feature index 7c25e7337..dba29fec2 100644 --- a/tests/integration/features/backforward.feature +++ b/tests/integration/features/backforward.feature @@ -4,6 +4,7 @@ Feature: Going back and forward. Scenario: Going back/forward Given I open data/backforward/1.txt When I open data/backforward/2.txt + And I run :tab-only And I run :back And I wait until data/backforward/1.txt is loaded And I reload @@ -15,13 +16,81 @@ Feature: Going back and forward. data/backforward/2.txt data/backforward/1.txt data/backforward/2.txt + And the session should look like: + windows: + - tabs: + - history: + - url: http://localhost:*/data/backforward/1.txt + - active: true + url: http://localhost:*/data/backforward/2.txt - Scenario: Going back without history - Given I open data/backforward/1.txt - When I run :back - Then the error "At beginning of history." should be shown. + Scenario: Going back in a new tab + Given I open data/backforward/1.txt + When I open data/backforward/2.txt + And I run :tab-only + And I run :back -t + And I wait until data/backforward/1.txt is loaded + Then the session should look like: + windows: + - tabs: + - history: + - url: http://localhost:*/data/backforward/1.txt + - active: true + url: http://localhost:*/data/backforward/2.txt + - active: true + history: + - active: true + url: http://localhost:*/data/backforward/1.txt + - url: http://localhost:*/data/backforward/2.txt - Scenario: Going forward without history - Given I open data/backforward/1.txt - When I run :forward - Then the error "At end of history." should be shown. + Scenario: Going back in a new background tab + Given I open data/backforward/1.txt + When I open data/backforward/2.txt + And I run :tab-only + And I run :back -b + And I wait until data/backforward/1.txt is loaded + Then the session should look like: + windows: + - tabs: + - active: true + history: + - url: http://localhost:*/data/backforward/1.txt + - active: true + url: http://localhost:*/data/backforward/2.txt + - history: + - active: true + url: http://localhost:*/data/backforward/1.txt + - url: http://localhost:*/data/backforward/2.txt + + Scenario: Going back in a new window + Given I have a fresh instance + When I open data/backforward/1.txt + And I open data/backforward/2.txt + And I run :back -w + And I wait until data/backforward/1.txt is loaded + Then the session should look like: + windows: + - tabs: + - active: true + history: + - url: about:blank + - url: http://localhost:*/data/backforward/1.txt + - active: true + url: http://localhost:*/data/backforward/2.txt + - tabs: + - active: true + history: + - url: about:blank + - active: true + url: http://localhost:*/data/backforward/1.txt + - url: http://localhost:*/data/backforward/2.txt + + Scenario: Going back without history + Given I open data/backforward/1.txt + When I run :back + Then the error "At beginning of history." should be shown. + + Scenario: Going forward without history + Given I open data/backforward/1.txt + When I run :forward + Then the error "At end of history." should be shown.