Zfilipin has uploaded a new change for review.

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

Change subject: Fixed broken Selenium test
......................................................................

Fixed broken Selenium test

The problems was that visual editor is the default editor at
en.wikipedia.beta.wmflabs.org, and the test was expecting source editor.

The test now works also locally, using mediawiki-vagrant.

Removed headers from some files. We no longer use those headers.

Removed cucumber tags we no longer use, mostly internet explorer.

Added missing dependency (rake) to gemfile.

Bug: T126463
Change-Id: Ia5809f40719a2fe0c6c94338072a38765fa5c87b
---
M Gemfile
M Gemfile.lock
M tests/browser/features/math.feature
M tests/browser/features/step_definitions/math_steps.rb
M tests/browser/features/support/pages/does_not_exist_page.rb
M tests/browser/features/support/pages/edit_page.rb
6 files changed, 10 insertions(+), 56 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/09/269709/1

diff --git a/Gemfile b/Gemfile
index 5ac60ed..7689031 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,5 @@
 source 'https://rubygems.org'
 
 gem 'mediawiki_selenium', '~> 1.6.5'
+gem 'rake', '~> 10.5'
 gem 'rubocop', '~> 0.33.0', require: false
diff --git a/Gemfile.lock b/Gemfile.lock
index 3a6a96b..e0c8c2c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -63,6 +63,7 @@
       ast (>= 1.1, < 3.0)
     powerpack (0.1.1)
     rainbow (2.0.0)
+    rake (10.5.0)
     rest-client (1.8.0)
       http-cookie (>= 1.0.2, < 2.0)
       mime-types (>= 1.16, < 3.0)
@@ -98,6 +99,7 @@
 
 DEPENDENCIES
   mediawiki_selenium (~> 1.6.5)
+  rake (~> 10.5)
   rubocop (~> 0.33.0)
 
 BUNDLED WITH
diff --git a/tests/browser/features/math.feature 
b/tests/browser/features/math.feature
index 48c8c05..6dcb5f2 100644
--- a/tests/browser/features/math.feature
+++ b/tests/browser/features/math.feature
@@ -1,23 +1,11 @@
-#
-# This file is subject to the license terms in the LICENSE file found in the
-# qa-browsertests top-level directory and at
-# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
-# qa-browsertests, including this file, may be copied, modified, propagated, or
-# distributed except according to the terms contained in the LICENSE file.
-#
-# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
-# qa-browsertests top-level directory and at
-# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
-#
-@chrome @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_6 
@internet_explorer_7 @internet_explorer_8 @internet_explorer_9 
@internet_explorer_10 @login @phantomjs @test2.wikipedia.org
+@chrome @en.wikipedia.beta.wmflabs.org @firefox @login
 Feature: Math
 
   Scenario: Display simple math
     Given I am logged in
-      And I am at page that does not exist
-    When I click link Create
-      And I type <math>3 + 2</math>
+      And I am creating a page with source editor
+    When I type <math>3 + 2</math>
       And I click Preview
     Then the page should contain an img tag
       And alt for that img should be 3 + 2
-      And src for that img should come from //upload
+      And src for that img should contain /math/
diff --git a/tests/browser/features/step_definitions/math_steps.rb 
b/tests/browser/features/step_definitions/math_steps.rb
index 2918cf1..8a1f031 100644
--- a/tests/browser/features/step_definitions/math_steps.rb
+++ b/tests/browser/features/step_definitions/math_steps.rb
@@ -1,16 +1,4 @@
-#
-# This file is subject to the license terms in the LICENSE file found in the
-# qa-browsertests top-level directory and at
-# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
-# qa-browsertests, including this file, may be copied, modified, propagated, or
-# distributed except according to the terms contained in the LICENSE file.
-#
-# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
-# qa-browsertests top-level directory and at
-# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
-#
-
-Given(/^I am at page that does not exist$/) do
+Given(/^I am creating a page with source editor$/) do
   visit(DoesNotExistPage, using_params: { page_name: @random_string })
 end
 
@@ -30,10 +18,9 @@
   expect(on(EditPage).math_image_element.element.alt).to eq(alt)
 end
 
-Then(/^src for that img should come from (.+)$/) do |src|
+Then(/^src for that img should contain (.+)$/) do |src|
   expect(on(EditPage).math_image_element.element.src).to match Regexp.escape 
src
 end
-
 
 Then(/^the page should contain an img tag$/) do
   expect(on(EditPage).math_image_element.when_present).to be_visible
diff --git a/tests/browser/features/support/pages/does_not_exist_page.rb 
b/tests/browser/features/support/pages/does_not_exist_page.rb
index dbd01f1..b5699f8 100644
--- a/tests/browser/features/support/pages/does_not_exist_page.rb
+++ b/tests/browser/features/support/pages/does_not_exist_page.rb
@@ -1,18 +1,5 @@
-#
-# This file is subject to the license terms in the LICENSE file found in the
-# qa-browsertests top-level directory and at
-# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
-# qa-browsertests, including this file, may be copied, modified, propagated, or
-# distributed except according to the terms contained in the LICENSE file.
-#
-# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
-# qa-browsertests top-level directory and at
-# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
-#
 class DoesNotExistPage
   include PageObject
 
-  page_url '<%=params[:page_name]%>'
-
-  a(:action_edit, css: 'li#ca-edit > span > a')
+  page_url '<%=params[:page_name]%>?action=edit'
 end
diff --git a/tests/browser/features/support/pages/edit_page.rb 
b/tests/browser/features/support/pages/edit_page.rb
index bfb6903..471f911 100644
--- a/tests/browser/features/support/pages/edit_page.rb
+++ b/tests/browser/features/support/pages/edit_page.rb
@@ -1,14 +1,3 @@
-#
-# This file is subject to the license terms in the LICENSE file found in the
-# qa-browsertests top-level directory and at
-# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
-# qa-browsertests, including this file, may be copied, modified, propagated, or
-# distributed except according to the terms contained in the LICENSE file.
-#
-# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
-# qa-browsertests top-level directory and at
-# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
-#
 class EditPage
   include PageObject
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5809f40719a2fe0c6c94338072a38765fa5c87b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Zfilipin <zfili...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to