2014-06-23 17:27:07 +00:00
|
|
|
#
|
|
|
|
# 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
|
2015-09-02 15:19:50 +00:00
|
|
|
visit(DoesNotExistPage, using_params: { page_name: @random_string })
|
2014-06-23 17:27:07 +00:00
|
|
|
end
|
|
|
|
|
2015-12-14 20:22:29 +00:00
|
|
|
When(/^I click link Create$/) do
|
|
|
|
on(DoesNotExistPage).action_edit_element.when_present.click
|
2014-06-23 17:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
When(/^I click Preview$/) do
|
|
|
|
on(EditPage).preview
|
|
|
|
end
|
|
|
|
|
|
|
|
When(/^I type (.+)$/) do |write_text|
|
2015-09-02 15:19:04 +00:00
|
|
|
on(EditPage).article_text = write_text
|
2014-06-23 17:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then(/^alt for that img should be (.+)$/) do |alt|
|
2014-12-11 06:29:59 +00:00
|
|
|
expect(on(EditPage).math_image_element.element.alt).to eq(alt)
|
2014-06-23 17:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then(/^src for that img should come from (.+)$/) do |src|
|
2015-09-02 13:57:39 +00:00
|
|
|
expect(on(EditPage).math_image_element.element.src).to match Regexp.escape src
|
2014-06-23 17:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
Then(/^the page should contain an img tag$/) do
|
2014-12-11 06:29:59 +00:00
|
|
|
expect(on(EditPage).math_image_element.when_present).to be_visible
|
2015-09-02 13:57:39 +00:00
|
|
|
end
|