[BrowserTest] Add true internationalized content support to language screenshot

* All translations will be in tests/browser/i18n folder
* Hebrew json’s are added, which needs to be translated.

Paired with Zeljko.

Bug: T105466
Change-Id: I4ae516758fb01a41f0dcf53c7cf3e609c7601cf3
This commit is contained in:
Vikas S Yaligar 2015-07-15 18:13:39 -05:00 committed by Amir E. Aharoni
parent 43eb3493a8
commit 8b7b20b934
7 changed files with 46 additions and 4 deletions

View file

@ -52,11 +52,12 @@ Feature: Language Screenshot
When I click on list and indentation button
Then I should see list and indentation dropdown
Scenario: VisualEditor_External_link
Given I go to the "Links VisualEditor Screenshot" page with source content "Links VisualEditor Screenshot"
@language_screenshot
Scenario: VisualEditor_Internal_link
Given I go to the "Links VisualEditor Screenshot" page with source content "Hello World" for language screenshot
And I click in the editable part
And I select "World" in editable part
And I click the Link button
When I enter http://www.mediawiki.org into link Content box
Then I should see link Content box with dropdown options
Scenario: VisualEditor_Link_editing_inline

View file

@ -50,6 +50,14 @@ Given(/^I go to "(.*?)" page containing math formula/) do |page_title|
step "I go to the \"#{page_title}\" page with source content \"<math>2+2</math>\""
end
Given(/^I select "(.*?)" in editable part$/) do |string|
on(VisualEditorPage).content_element.select_text translate(string)
end
Given(/^I go to the "(.*?)" page with source content "(.*?)" for language screenshot$/) do |page, content|
step "I go to the \"#{page}\" page with source content \"#{translate(content)}\""
end
When(/^I click on the Insert menu$/) do
on(VisualEditorPage).insert_indicator_down_element.when_present.click
end

View file

@ -4,3 +4,9 @@ require 'mediawiki_api'
require 'screenshot'
include MediawikiApi
def translate(string)
file = File.read "i18n/#{ENV['LANGUAGE_SCREENSHOT_CODE']}.json"
json = JSON.parse(file)
json["languagescreenshot-#{string.downcase.gsub(' ', '-')}-text"] || ''
end

View file

@ -84,7 +84,7 @@ class VisualEditorPage
div(:ip_warning, class: 've-ui-mwNoticesPopupTool-item', text: /Your IP address/)
div(:language_notification, class: 'tipsy-inner')
div(:left_navigation, id: 'left-navigation')
unordered_list(:link_list, class: 'oo-ui-widget oo-ui-widget-enabled oo-ui-selectWidget oo-ui-selectWidget-depressed oo-ui-clippableElement-clippable oo-ui-menuWidget oo-ui-textInputMenuWidget oo-ui-lookupWidget-menu ve-ui-mwLinkTargetInputWidget-menu')
div(:link_list, class: 'oo-ui-windowManager-floating')
div(:link_overlay_does_not_exist, text: /New page/)
div(:link_overlay_external_link, text: /External link.+New page/m)
div(:link_overlay_wiki_page, text: /Matching page/)

View file

@ -0,0 +1,9 @@
{
"@metadata": {
"authors": [
"Vikas Yaligar"
]
},
"languagescreenshot-hello-world-text": "Hello, World!",
"languagescreenshot-world-text": "World"
}

View file

@ -0,0 +1,9 @@
{
"@metadata": {
"authors": [
"Amire80"
]
},
"languagescreenshot-hello-world-text": "שלום עולם!",
"languagescreenshot-world-text": "עולם"
}

View file

@ -0,0 +1,9 @@
{
"@metadata": {
"authors": [
"Amire80"
]
},
"languagescreenshot-hello-world-text": "A text to show as content in VisualEditor.",
"languagescreenshot-world-text": "The word 'world' from {{msg-mw|languagescreenshot-hello-world-text}}."
}