Fixed failing Selenium test

When user is logged in, visual editor is the default editor. When user
is not logged in, source editor is the default editor. When the test
does not log in, everything works just fine.

Bug: T126463
Change-Id: I1f15000a275657c0a92172781f57c5d1db537dcc
This commit is contained in:
Željko Filipin 2016-02-19 13:32:00 +01:00 committed by Hashar
parent e750104394
commit a4948c208a
4 changed files with 6 additions and 14 deletions

View File

@ -1,9 +1,8 @@
@chrome @en.wikipedia.beta.wmflabs.org @firefox @login
@chrome @en.wikipedia.beta.wmflabs.org @firefox
Feature: Math
Scenario: Display simple math
Given I am logged in
And I am creating a page with source editor
Given I am editing a random page with source editor
When I type <math>3 + 2</math>
And I click Preview
Then the page should contain an img tag

View File

@ -1,9 +1,5 @@
Given(/^I am creating a page with source editor$/) do
visit(DoesNotExistPage, using_params: { page_name: @random_string })
end
When(/^I click link Create$/) do
on(DoesNotExistPage).action_edit_element.when_present.click
Given(/^I am editing a random page with source editor$/) do
visit EditPage
end
When(/^I click Preview$/) do

View File

@ -1,5 +0,0 @@
class DoesNotExistPage
include PageObject
page_url '<%=params[:page_name]%>?action=edit'
end

View File

@ -1,6 +1,8 @@
class EditPage
include PageObject
page_url 'Special:Random?action=edit'
text_area(:article_text, id: 'wpTextbox1')
img(:math_image, class: 'tex')
button(:preview, id: 'wpPreview')