mediawiki-extensions-Revisi.../tests/browser/features/support/step_definitions/common_steps.rb
addshore 6101897460 Add browser tests for tutorial / help dialog
Testing the visibility / presence of things around
the dialog appears to be hard and the DOM for the dialog
remains unchanged when shown / hidden as far as I can see.

These tests test that the dialog is only shown once per
user.
And that the sequence of the dialog works in regards to the correct
buttons being present at the correct times.

Bug: T133278
Change-Id: Ia86cb69573da3e888c2897b8b50f1d2e5c61d8d4
2016-07-04 13:39:19 +00:00

38 lines
1.1 KiB
Ruby

Given(/^I am on the "(.*?)" page$/) do |page|
visit(ArticlePage, using_params: { article_name: page })
end
Given(/^I am on the "(.*?)" diff page$/) do |page|
visit(ArticlePage, using_params: { article_name: page, query: 'type=revision&diff=' })
end
Given(/^The page "(.+)" has the following edits:$/) do |page, table|
page = page.gsub(' ', '_')
table.rows.each { |(text)| api.edit(title: page, text: text) }
end
Given(/^I refresh the page$/) do
on(ArticlePage) do |page|
page.refresh
end
end
Given(/^The RevisionSlider has loaded$/) do
on(DiffPage).wait_for_slider_to_load
end
Then(/^RevisionSlider is enabled as a beta feature$/) do
visit(SpecialPreferencesPage).enable_revisionslider
end
Then(/^RevisionSlider is disabled as a beta feature$/) do
visit(SpecialPreferencesPage).disable_revisionslider
end
Then(/^There should be a RevisionSlider container/) do
expect{ on(DiffPage).revisionslider_container }.not_to raise_error
end
Then(/^There should not be a RevisionSlider placeholder$/) do
expect{ on(DiffPage).revisionslider_placeholder }.to raise_error
end