2016-07-04 13:56:00 +00:00
|
|
|
Given(/^I am on the page$/) do
|
|
|
|
visit(ArticlePage, using_params: { article_name: "RevisionSlider-#{@random_string}" })
|
2016-06-27 12:38:23 +00:00
|
|
|
end
|
|
|
|
|
2016-07-04 13:56:00 +00:00
|
|
|
Given(/^I am on the diff page$/) do
|
|
|
|
visit(ArticlePage, using_params: { article_name: "RevisionSlider-#{@random_string}", query: 'type=revision&diff=' })
|
2016-06-27 12:38:23 +00:00
|
|
|
end
|
|
|
|
|
2016-07-04 13:56:00 +00:00
|
|
|
Given(/^a page with (\d+) revision\(s\) exists$/) do |number_of_revisions|
|
|
|
|
(1..number_of_revisions.to_i).each do |i|
|
2016-07-04 16:26:13 +00:00
|
|
|
api.edit(title: "RevisionSlider-#{@random_string}", text: "RS-Text-#{i}", summary: "RS-Summary-#{i}")
|
2016-07-04 13:56:00 +00:00
|
|
|
end
|
2016-06-27 12:38:23 +00:00
|
|
|
end
|
|
|
|
|
2016-06-29 10:52:05 +00:00
|
|
|
Given(/^I refresh the page$/) do
|
|
|
|
on(ArticlePage) do |page|
|
|
|
|
page.refresh
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-07-05 14:16:22 +00:00
|
|
|
When(/^I click the browser back button$/) do
|
|
|
|
on(ArticlePage).back
|
|
|
|
end
|
|
|
|
|
|
|
|
When(/^I click the browser forward button$/) do
|
|
|
|
on(ArticlePage).forward
|
|
|
|
end
|
|
|
|
|
2016-06-27 12:38:23 +00:00
|
|
|
Given(/^The RevisionSlider has loaded$/) do
|
|
|
|
on(DiffPage).wait_for_slider_to_load
|
|
|
|
end
|
|
|
|
|
2016-07-04 14:43:47 +00:00
|
|
|
Given(/^The window size is (\d+) by (\d+)$/) do |width,height|
|
|
|
|
browser.window.resize_to(width.to_i, height.to_i)
|
|
|
|
end
|
|
|
|
|
2016-06-27 12:38:23 +00:00
|
|
|
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
|
|
|
|
|
2016-08-09 16:34:53 +00:00
|
|
|
Then(/^There should be a RevisionSlider container/) do
|
|
|
|
expect{ on(DiffPage).revisionslider_container }.not_to raise_error
|
2016-06-27 12:38:23 +00:00
|
|
|
end
|
|
|
|
|
2016-08-09 16:34:53 +00:00
|
|
|
Then(/^There should not be a RevisionSlider placeholder$/) do
|
|
|
|
expect{ on(DiffPage).revisionslider_placeholder }.to raise_error
|
2016-06-27 12:38:23 +00:00
|
|
|
end
|