Allow browser tests to add more revisions easily

This allows an arbitrary number of revisions to be created
on a page very easily.
The page created will have a name relating to RevisionSlider
suffixed by a random float.

The base logic for this is taken from:
Ic165f108517c534a4b1c12883621b3624c7b0336

This patch also removes the @vagrant tags as RevisonSlider
is not yet in vragrant.
Please see T139296 for the ticket to add it.

Bug: T133278
Change-Id: I8a25db411bee2fa44555a23d1a840907a185c998
This commit is contained in:
addshore 2016-07-04 14:56:00 +01:00
parent 6101897460
commit 1671a07d7d
3 changed files with 15 additions and 20 deletions

View file

@ -1,19 +1,16 @@
@chrome @en.wikipedia.beta.wmflabs.org @firefox @test2.wikipedia.org @vagrant @integration
@chrome @en.wikipedia.beta.wmflabs.org @firefox @integration
Feature: RevisionSlider betafeature
Background:
Given I am logged in
And The page "RevisionSliderTestPage1" has the following edits:
| RS text |
| RS longer text |
| RS less text |
And a page with 2 revision(s) exists
Scenario: RevisionSlider is not loaded when feature disabled
Given RevisionSlider is disabled as a beta feature
And I am on the "RevisionSliderTestPage1" diff page
And I am on the diff page
Then There should not be a RevisionSlider placeholder
Scenario: RevisionSlider is loaded when feature enabled
Given RevisionSlider is enabled as a beta feature
And I am on the "RevisionSliderTestPage1" diff page
And I am on the diff page
And The RevisionSlider has loaded
Then There should be a RevisionSlider container

View file

@ -1,14 +1,11 @@
@chrome @en.wikipedia.beta.wmflabs.org @firefox @test2.wikipedia.org @vagrant @integration
@chrome @en.wikipedia.beta.wmflabs.org @firefox @integration
Feature: RevisionSlider help
Background:
Given I am logged in
And The page "RevisionSliderTestPage1" has the following edits:
| RS text |
| RS longer text |
| RS less text |
And a page with 2 revision(s) exists
And I have reset my preferences
And RevisionSlider is enabled as a beta feature
And I am on the "RevisionSliderTestPage1" diff page
And I am on the diff page
Scenario: RevisionSlider tutorial is present on first load only
Given The RevisionSlider has loaded

View file

@ -1,14 +1,15 @@
Given(/^I am on the "(.*?)" page$/) do |page|
visit(ArticlePage, using_params: { article_name: page })
Given(/^I am on the page$/) do
visit(ArticlePage, using_params: { article_name: "RevisionSlider-#{@random_string}" })
end
Given(/^I am on the "(.*?)" diff page$/) do |page|
visit(ArticlePage, using_params: { article_name: page, query: 'type=revision&diff=' })
Given(/^I am on the diff page$/) do
visit(ArticlePage, using_params: { article_name: "RevisionSlider-#{@random_string}", 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) }
Given(/^a page with (\d+) revision\(s\) exists$/) do |number_of_revisions|
(1..number_of_revisions.to_i).each do |i|
api.edit(title: "RevisionSlider-#{@random_string}", text: "Text-#{i}")
end
end
Given(/^I refresh the page$/) do