Merge "[BrowserTest] Updating test for Media Settings interface"

This commit is contained in:
jenkins-bot 2015-02-03 07:42:33 +00:00 committed by Gerrit Code Review
commit 07e95ac365
6 changed files with 47 additions and 12 deletions

View file

@ -5,6 +5,6 @@ source 'https://rubygems.org'
gem 'chunky_png'
gem 'mediawiki_api'
gem 'mediawiki_selenium'
gem 'mediawiki_selenium', '~> 0.4.1'
gem 'rspec'
gem 'rubocop', require: false

View file

@ -101,6 +101,6 @@ PLATFORMS
DEPENDENCIES
chunky_png
mediawiki_api
mediawiki_selenium
mediawiki_selenium (~> 0.4.1)
rspec
rubocop

View file

@ -0,0 +1,27 @@
@en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 @login @safari @test2.wikipedia.org
Feature: VisualEditor Media Interface
Background:
Given I go to the "Media Interface VisualEditor Test" page with content "Media Interface VisualEditor Test"
And I click in the editable part
Scenario Outline: VisualEditor insert new media
Given I click Media
And I enter <search_term> into media Search box
And I select an Image
And I click Use this image
When I fill in the text area for caption with "caption"
And I fill in the test area for alternative text with "alt text"
And I click "Insert"
And I click Save page
And I click Review your changes
Then diff view should show proper caption and alt text
Examples:
| search_term | expected_markup_text |
| San Francisco | [[File:California county map (San Francisco County highlighted).svg\|thumb\|150x150px]] |
| Flash video | [[File:Flash video file icon.png\|thumb\|32x32px]] |
| cunfrunti | [[File:Cunfrunti.mpg.OGG\|thumb\|183x183px]] |

View file

@ -9,14 +9,12 @@ Feature: VisualEditor Media Interface
Given I click Media
And I enter <search_term> into media Search box
And I select an Image
When I click Save page the second time
And I click Use this image
And I click Insert
And I click Save page
And I click Review your changes
Then <expected_markup_text> should appear in the media diff view
And I can click the X on the media save box
Examples:
| search_term | expected_markup_text |
| San Francisco | [[File:California county map (San Francisco County highlighted).svg\|thumb\|150x150px]] |
| Flash video | [[File:Flash video file icon.png\|thumb\|32x32px]] |
| cunfrunti | [[File:Cunfrunti.mpg.OGG\|thumb\|183x183px]] |
| search_term | expected_markup_text |
| bug | [[File:Folgers.ogv\|thumb]] |

View file

@ -13,7 +13,15 @@ When(/^I enter (.+) into media Search box$/) do |content|
end
When(/^I select an Image$/) do
on(VisualEditorPage).media_select_element.when_present.click
on(VisualEditorPage).media_select_element.when_present(20).click
end
When (/^I click Use this image/) do
on(VisualEditorPage).use_image_button_element.when_present.click
end
When (/^I click Insert$/) do
on(VisualEditorPage).media_insert_button_element.when_present.click
end
Then(/^(.+) should appear in the media diff view$/) do |headings_string|

View file

@ -86,8 +86,10 @@ class VisualEditorPage
figure(:media_image, index: 0)
span(:media_insert_menu, class: 'oo-ui-tool-name-media')
text_field(:media_search, css: 'div.oo-ui-textInputWidget > input')
div(:media_select, class: 've-ui-mwMediaResultWidget-overlay')
div(:media_select, css: 'div.ve-ui-mwMediaResultWidget-row:nth-child(1) > div:nth-child(1) > div:nth-child(3)')
div(:medium_dialog, class: 'oo-ui-window oo-ui-dialog oo-ui-dialog-open oo-ui-dialog-medium')
span(:use_image_button, css: '.oo-ui-processDialog-actions-primary > div:nth-child(1) > a:nth-child(1) > span:nth-child(2)')
span(:media_insert_button, css: '.oo-ui-flaggedElement-constructive > a:nth-child(1) > span:nth-child(2)')
checkbox(:minor_edit, id: 'wpMinoredit')
div(:no_unused_fields, text: 'No unused fields')
a(:new_link, class: 've-ce-linkAnnotation ve-ce-mwInternalLinkAnnotation new')
@ -122,10 +124,10 @@ class VisualEditorPage
div(:references_title, class: 'oo-ui-processDialog-location', text: /References/)
a(:remove_parameter, css: '.ve-ui-mwParameterPage-removeButton > a:nth-child(1)')
span(:return_to_save, class: 'oo-ui-labelElement-label', text: 'Return to save form')
a(:review_changes, css: '.oo-ui-processDialog-actions-other > div:nth-child(1) > a:nth-child(1)')
a(:review_changes, css: '.oo-ui-window-content-setup > div:nth-child(3) > div:nth-child(1) > div:nth-child(1) > a:nth-child(1)')
span(:review_failed, text: 'No changes to review')
div(:right_navigation, id: 'p-views')
a(:save_page, css: '.ve-init-mw-viewPageTarget-toolbar-actions .oo-ui-buttonElement-button')
a(:save_page, css: '.oo-ui-flaggedElement-progressive > a:nth-child(1)')
div(:save_enabled, css: 'div.ve-init-mw-viewPageTarget-toolbar-actions > div.oo-ui-flaggedElement-progressive.oo-ui-widget-enabled')
a(:second_reference, text: '[1]', index: 2)
span(:second_save_page, css: '.oo-ui-processDialog-actions-primary > div:nth-child(1) > a:nth-child(1) > span:nth-child(2)')