mediawiki-extensions-Popups/tests/browser/features/support/step_definitions/common_steps.rb
Sam Smith a0b01f86ab Hygiene: Remove "I am on the ... page" step
Merge the "Given the test page has been created" and "Given I am on the
... page" as they are only ever used together to mean "Given I am on the
test page".

Supporting changes:
* samples/links.wikitext -> fixtures/test_page.wikitext as it's more
  obvious what the file is.

Change-Id: Ide261a8e8c55133ab2a13a80c48e266252f61f5f
2016-12-13 14:25:37 +00:00

20 lines
522 B
Ruby

TEST_PAGE_TITLE = 'Popups test page'
Given(/^I have enabled the beta feature$/) do
visit(SpecialPreferencesPage).enable_page_previews
end
Given(/^I am on the test page$/) do
api.create_page TEST_PAGE_TITLE, File.read('fixtures/test_page.wikitext')
visit(ArticlePage, using_params: { article_name: TEST_PAGE_TITLE })
end
Given(/^the RL module has loaded$/) do
on(ArticlePage) do |page|
page.wait_until do
browser.execute_script("return mw.loader.getState('ext.popups') === 'ready'")
end
end
end