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 Feature: Math
Scenario: Display simple math Scenario: Display simple math
Given I am logged in Given I am editing a random page with source editor
And I am creating a page with source editor
When I type <math>3 + 2</math> When 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

View File

@ -1,9 +1,5 @@
Given(/^I am creating a page with source editor$/) do Given(/^I am editing a random page with source editor$/) do
visit(DoesNotExistPage, using_params: { page_name: @random_string }) visit EditPage
end
When(/^I click link Create$/) do
on(DoesNotExistPage).action_edit_element.when_present.click
end end
When(/^I click Preview$/) do 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 class EditPage
include PageObject include PageObject
page_url 'Special:Random?action=edit'
text_area(:article_text, id: 'wpTextbox1') text_area(:article_text, id: 'wpTextbox1')
img(:math_image, class: 'tex') img(:math_image, class: 'tex')
button(:preview, id: 'wpPreview') button(:preview, id: 'wpPreview')