Removed random page

Using a dedicated page instead of a random page. Paired  with Amir
Aharoni.
Bug: 62479
Change-Id: I3750ecf972f52f205fd30855455ef6259b9c911d
This commit is contained in:
Zeljko Filipin
2014-03-11 16:13:16 +01:00
parent 3797187998
commit b4af650730
13 changed files with 35 additions and 47 deletions

View File

@@ -3,7 +3,7 @@ Feature: Accept-Language
Scenario Outline: Accept-Language Scenario Outline: Accept-Language
Given that my browser's accept language is <language> Given that my browser's accept language is <language>
When I visit a random page When I am at the preferences page
Then link to the main page has text <text> Then link to the main page has text <text>
Examples: Examples:

View File

@@ -25,7 +25,7 @@ Feature: Autonym font
And elements that are not Interlanguage links should not use Autonym font And elements that are not Interlanguage links should not use Autonym font
Scenario: Autonym font is used in the ULS language search dialog for input language selection by anonymous users Scenario: Autonym font is used in the ULS language search dialog for input language selection by anonymous users
Given I am at random page Given I am at the main page
And I open the Universal Language Selector And I open the Universal Language Selector
And I open Input side panel of language settings And I open Input side panel of language settings
When I click the button with the ellipsis When I click the button with the ellipsis

View File

@@ -10,7 +10,7 @@ input method.
The input method indicator is shown when input field gets a focus. The input method indicator is shown when input field gets a focus.
Given I am at random page Given I am at the main page
When I click on an input box When I click on an input box
Then I should see the input method indicator Then I should see the input method indicator
@@ -19,7 +19,7 @@ input method.
Input method menu is shown when user clicks the input method indicator. Input method menu is shown when user clicks the input method indicator.
Given I am at random page Given I am at the main page
When I click on an input box When I click on an input box
And I click on the input method indicator And I click on the input method indicator
Then I should see input methods for English Then I should see input methods for English
@@ -41,13 +41,13 @@ input method.
Chosen input method selection persists across page loads. Chosen input method selection persists across page loads.
Given I am at random page Given I am at the main page
When I open the input method menu When I open the input method menu
And I choose ml as the input language And I choose ml as the input language
And I open the input method menu And I open the input method menu
And I click on the Malayalam InScript 2 menu item And I click on the Malayalam InScript 2 menu item
And I press Control-M And I press Control-M
And I go to another random page And I reload the page
And I click on an input box And I click on an input box
And I press Control-M And I press Control-M
Then I should see the input method indicator Then I should see the input method indicator

View File

@@ -4,7 +4,7 @@ Feature: Live preview of display language changes
Background: Background:
Given I am logged in Given I am logged in
And I have reset my preferences And I have reset my preferences
And I am at random page And I am at the main page
@needs-custom-setup @commons.wikimedia.beta.wmflabs.org @needs-custom-setup @commons.wikimedia.beta.wmflabs.org
Scenario: Display language change is previewed immediately Scenario: Display language change is previewed immediately

View File

@@ -15,12 +15,12 @@ Feature: Persistent settings
Scenario: Interface font sticks to another page Scenario: Interface font sticks to another page
When I apply the changes When I apply the changes
And I visit a random page And I am at the main page
Then the selected interface font must be OpenDyslexic Then the selected interface font must be OpenDyslexic
Scenario: Discarding a live preview of a font keeps the previous font Scenario: Discarding a live preview of a font keeps the previous font
When I close the panel to discard the changes When I close the panel to discard the changes
And I visit a random page And I am at the main page
Then the selected interface font must be Systemschriftart Then the selected interface font must be Systemschriftart
Scenario: Changing both a font and an input method is saved Scenario: Changing both a font and an input method is saved
@@ -30,6 +30,6 @@ Feature: Persistent settings
And I click on the link to select Malayalam And I click on the link to select Malayalam
And I select the ml-inscript2 input method in the panel And I select the ml-inscript2 input method in the panel
And I apply the changes And I apply the changes
And I visit a random page And I am at the main page
Then the selected interface font must be OpenDyslexic Then the selected interface font must be OpenDyslexic
And the selected input method for Malayalam is ml-inscript2 And the selected input method for Malayalam is ml-inscript2

View File

@@ -15,7 +15,7 @@ Feature: Settings panel
| logged in | | logged in |
Scenario: How to use link appears in the Input settings panel Scenario: How to use link appears in the Input settings panel
Given I am at random page Given I am at the main page
When I open ULS When I open ULS
And I switch to Input panel of language settings And I switch to Input panel of language settings
And I click the button with the ellipsis And I click the button with the ellipsis
@@ -24,7 +24,7 @@ Feature: Settings panel
Then I should see the How to use link near the Malayalam transliteration item Then I should see the How to use link near the Malayalam transliteration item
Scenario: More languages (input language selection) Scenario: More languages (input language selection)
Given I am at random page Given I am at the main page
When I open ULS When I open ULS
And I switch to Input panel of language settings And I switch to Input panel of language settings
And I click the button with the ellipsis And I click the button with the ellipsis

View File

@@ -3,10 +3,10 @@ Given(/^that my browser's accept language is (.+)$/) do |language|
$session_id = @browser.driver.instance_variable_get(:@bridge).session_id $session_id = @browser.driver.instance_variable_get(:@bridge).session_id
end end
When(/^I visit a random page$/) do When(/^I am at the preferences page$/) do
visit RandomPage visit PreferencesPage
end end
Then(/^link to the main page has text (.+)$/) do |text| Then(/^link to the main page has text (.+)$/) do |text|
on(RandomPage).main_page_element.text.should == text on(MainPage).main_page_element.text.should == text
end end

View File

@@ -1,5 +1,5 @@
Given(/^I am at random page$/) do Given(/^I am at the main page$/) do
visit RandomPage visit MainPage
end end
Given(/^I am logged out$/) do Given(/^I am logged out$/) do

View File

@@ -1,7 +1,7 @@
# encoding: utf-8 # encoding: utf-8
Given(/^I am on a wiki in Kotava language$/) do Given(/^I am on a wiki in Kotava language$/) do
visit RandomPage step "I am at the main page"
# Fake a Kotava Wiki # Fake a Kotava Wiki
@browser.execute_script( "mw.config.set( 'wgContentLanguage', 'avk' )" ) @browser.execute_script( "mw.config.set( 'wgContentLanguage', 'avk' )" )
end end
@@ -54,10 +54,6 @@ When(/^I press Control-M$/) do
on(IMEPage).search_input_element.send_keys [:control, "m"] on(IMEPage).search_input_element.send_keys [:control, "m"]
end end
When(/^I go to another random page$/) do
visit RandomPage
end
Then(/^in it there must be an element with Malayalam text$/) do Then(/^in it there must be an element with Malayalam text$/) do
# 'input_method_enabled' alone only returns [] # 'input_method_enabled' alone only returns []
on(IMEPage) do |page| on(IMEPage) do |page|

View File

@@ -15,7 +15,7 @@ Given(/^I select a language different than English for display language$/) do
end end
When(/^I click on the link to select Malayalam$/) do When(/^I click on the link to select Malayalam$/) do
on(RandomPage).malayalam_element.click on(MainPage).malayalam_element.click
end end
Then(/^I should see the text in the language panel in (.+?)$/) do |language| Then(/^I should see the text in the language panel in (.+?)$/) do |language|

View File

@@ -4,6 +4,19 @@ class MainPage
include URL include URL
page_url URL.url("Main_Page") page_url URL.url("Main_Page")
span(:cog, title: "Language settings")
a(:create_a_book, text: "Create a book")
a(:download_as_pdf, text: "Download as PDF")
a(:download_the_file, text: "Download the file")
li(:main_page, id: "n-mainpage-description")
div(:asia, id: "AS")
a(:malayalam) do |page|
page.asia_element.element.li(lang: "ml")
end
a(:print_export, text: "Print/export")
a(:printable_version, text: "Printable version")
button(:search_button, id: "searchButton")
def non_interlanguage_links_use_autonym_font? def non_interlanguage_links_use_autonym_font?
@browser.elements(css: "#p-lang li:not(.interlanguage-link)").collect do |element| @browser.elements(css: "#p-lang li:not(.interlanguage-link)").collect do |element|
element.style("font-family") element.style("font-family")

View File

@@ -1,21 +0,0 @@
# encoding: utf-8
class RandomPage
include PageObject
include URL
page_url URL.url("Special:Random")
span(:cog, title: "Language settings")
a(:create_a_book, text: "Create a book")
a(:download_as_pdf, text: "Download as PDF")
a(:download_the_file, text: "Download the file")
li(:main_page, id: "n-mainpage-description")
div(:asia, id: "AS")
a(:malayalam) do |page|
page.asia_element.element.li(lang: "ml")
end
a(:print_export, text: "Print/export")
a(:printable_version, text: "Printable version")
button(:search_button, id: "searchButton")
end

View File

@@ -15,13 +15,13 @@ Feature: Trigger in personal toolbar
or the settings panel, depending on whether language selection for or the settings panel, depending on whether language selection for
anonymous users is disabled. This and next test cover both cases. anonymous users is disabled. This and next test cover both cases.
Given I am at random page Given I am at the main page
When I click language selector trigger element When I click language selector trigger element
Then I see the logged in language settings panel Then I see the logged in language settings panel
Scenario: Open language selector when logged out Scenario: Open language selector when logged out
Given I am at random page Given I am at the main page
When I click language selector trigger element When I click language selector trigger element
Then I should see the language selector Then I should see the language selector