Gilles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/125997

Change subject: Add history back button test to E2E
......................................................................

Add history back button test to E2E

The scrolling logic has broken specifically when navigating with the
back button (as opposed to pressing the "close" button). This change
aims to test that scenario.

Change-Id: Ibe31b319c882b7de2a84ae143652144093c50f1c
---
M tests/browser/features/basic_mmv_navigation.feature
M tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb
2 files changed, 10 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/97/125997/1

diff --git a/tests/browser/features/basic_mmv_navigation.feature 
b/tests/browser/features/basic_mmv_navigation.feature
index d25dac0..798a227 100644
--- a/tests/browser/features/basic_mmv_navigation.feature
+++ b/tests/browser/features/basic_mmv_navigation.feature
@@ -24,3 +24,7 @@
     When I close MMV
     Then I should be navigated back to the original wiki article
     Then the wiki article should be scrolled to the same position as before 
opening MMV
+    When I click on the first image in the article
+    And I press the browser back button
+    Then I should be navigated back to the original wiki article
+    Then the wiki article should be scrolled to the same position as before 
opening MMV
\ No newline at end of file
diff --git 
a/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb 
b/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb
index 3e57c07..8834e9b 100644
--- a/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb
+++ b/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb
@@ -31,6 +31,12 @@
   end
 end
 
+When(/^I press the browser back button$/) do
+  on(LightboxDemoPage) do |page|
+    page.execute_script("window.history.back();");
+  end
+end
+
 Then(/^I should be navigated back to the original wiki article$/) do
   on(LightboxDemoPage) do |page|
     page.image1_in_article_element.should be_visible

-- 
To view, visit https://gerrit.wikimedia.org/r/125997
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe31b319c882b7de2a84ae143652144093c50f1c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Gilles <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to