mediawiki-extensions-Math/tests/browser/features/step_definitions/math_steps.rb
Željko Filipin a4948c208a 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
2016-02-22 09:51:24 +00:00

24 lines
607 B
Ruby

Given(/^I am editing a random page with source editor$/) do
visit EditPage
end
When(/^I click Preview$/) do
on(EditPage).preview
end
When(/^I type (.+)$/) do |write_text|
on(EditPage).article_text = write_text
end
Then(/^alt for that img should be (.+)$/) do |alt|
expect(on(EditPage).math_image_element.element.alt).to eq(alt)
end
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
end