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
This commit is contained in:
Željko Filipin 2016-02-10 17:22:37 +01:00 committed by Physikerwelt
parent cc5241530e
commit 11825b9c17
6 changed files with 10 additions and 56 deletions

View file

@ -1,4 +1,5 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'mediawiki_selenium', '~> 1.6.5' gem 'mediawiki_selenium', '~> 1.6.5'
gem 'rake', '~> 10.5'
gem 'rubocop', '~> 0.33.0', require: false gem 'rubocop', '~> 0.33.0', require: false

View file

@ -63,6 +63,7 @@ GEM
ast (>= 1.1, < 3.0) ast (>= 1.1, < 3.0)
powerpack (0.1.1) powerpack (0.1.1)
rainbow (2.0.0) rainbow (2.0.0)
rake (10.5.0)
rest-client (1.8.0) rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0) http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0) mime-types (>= 1.16, < 3.0)
@ -98,6 +99,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
mediawiki_selenium (~> 1.6.5) mediawiki_selenium (~> 1.6.5)
rake (~> 10.5)
rubocop (~> 0.33.0) rubocop (~> 0.33.0)
BUNDLED WITH BUNDLED WITH

View file

@ -1,23 +1,11 @@
# @chrome @en.wikipedia.beta.wmflabs.org @firefox @login
# 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
Feature: Math Feature: Math
Scenario: Display simple math Scenario: Display simple math
Given I am logged in Given I am logged in
And I am at page that does not exist And I am creating a page with source editor
When I click link Create When I type <math>3 + 2</math>
And I type <math>3 + 2</math>
And I click Preview And I click Preview
Then the page should contain an img tag Then the page should contain an img tag
And alt for that img should be 3 + 2 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/

View file

@ -1,16 +1,4 @@
# Given(/^I am creating a page with source editor$/) do
# 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
visit(DoesNotExistPage, using_params: { page_name: @random_string }) visit(DoesNotExistPage, using_params: { page_name: @random_string })
end end
@ -30,11 +18,10 @@ Then(/^alt for that img should be (.+)$/) do |alt|
expect(on(EditPage).math_image_element.element.alt).to eq(alt) expect(on(EditPage).math_image_element.element.alt).to eq(alt)
end 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 expect(on(EditPage).math_image_element.element.src).to match Regexp.escape src
end end
Then(/^the page should contain an img tag$/) do Then(/^the page should contain an img tag$/) do
expect(on(EditPage).math_image_element.when_present).to be_visible expect(on(EditPage).math_image_element.when_present).to be_visible
end end

View file

@ -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 class DoesNotExistPage
include PageObject include PageObject
page_url '<%=params[:page_name]%>' page_url '<%=params[:page_name]%>?action=edit'
a(:action_edit, css: 'li#ca-edit > span > a')
end end

View file

@ -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 class EditPage
include PageObject include PageObject