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
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>
Examples:

View File

@@ -25,7 +25,7 @@ Feature: 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
Given I am at random page
Given I am at the main page
And I open the Universal Language Selector
And I open Input side panel of language settings
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.
Given I am at random page
Given I am at the main page
When I click on an input box
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.
Given I am at random page
Given I am at the main page
When I click on an input box
And I click on the input method indicator
Then I should see input methods for English
@@ -41,13 +41,13 @@ input method.
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
And I choose ml as the input language
And I open the input method menu
And I click on the Malayalam InScript 2 menu item
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 press Control-M
Then I should see the input method indicator

View File

@@ -4,7 +4,7 @@ Feature: Live preview of display language changes
Background:
Given I am logged in
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
Scenario: Display language change is previewed immediately

View File

@@ -15,12 +15,12 @@ Feature: Persistent settings
Scenario: Interface font sticks to another page
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
Scenario: Discarding a live preview of a font keeps the previous font
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
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 select the ml-inscript2 input method in the panel
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
And the selected input method for Malayalam is ml-inscript2

View File

@@ -15,7 +15,7 @@ Feature: Settings panel
| logged in |
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
And I switch to Input panel of language settings
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
Scenario: More languages (input language selection)
Given I am at random page
Given I am at the main page
When I open ULS
And I switch to Input panel of language settings
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
end
When(/^I visit a random page$/) do
visit RandomPage
When(/^I am at the preferences page$/) do
visit PreferencesPage
end
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

View File

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

View File

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

View File

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

View File

@@ -4,7 +4,20 @@ class MainPage
include URL
page_url URL.url("Main_Page")
def non_interlanguage_links_use_autonym_font?
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?
@browser.elements(css: "#p-lang li:not(.interlanguage-link)").collect do |element|
element.style("font-family")
end.to_s.match(/Autonym/) != nil

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
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
Then I see the logged in language settings panel
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
Then I should see the language selector