mediawiki-extensions-Popups/tests/browser/features/support/step_definitions/common_steps.rb
Sam Smith 4db0043ee7 Hygiene: Tidy up "core" acceptance tests
Changes:
* Rename the somewhat awkwardly named "popups_core" Cucumber feature and
  its accompanying step definitions to "previews".
* Remove as many references to Popups and HoverCards as possible.
* Use language consistent with the QUnit unit and integration tests and
  documentation, e.g. the user dwells on a link.
* Remove settings-related step definitions from the previews step
  definitions.

Change-Id: Ibc0d07e8394aeb640f9efaabfe10be5317bf4b8c
2016-12-13 14:14:08 +00:00

20 lines
530 B
Ruby

Given(/^the test page has been created$/) do
api.create_page 'Popups test page', File.read('samples/links.wikitext')
end
Given(/^I am on the "(.*?)" page$/) do |page|
visit(ArticlePage, using_params: { article_name: page })
end
Given(/^I have enabled the beta feature$/) do
visit(SpecialPreferencesPage).enable_page_previews
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