jenkins-bot has submitted this change and it was merged. Change subject: [BrowserTest] Updating test for Media Settings interface ......................................................................
[BrowserTest] Updating test for Media Settings interface Fixed the following: 1.The workflow was incomplete and incorporated new changes 2.Wrong css pointer to the first image 3.The Given statement was defined as When in step definition file 4.Removed unnecessary/obsolete steps that was making the test to fail while we can verify the basic functionality with miminum steps. Change-Id: Ic8a265678900ed52bbed6d90e971d6c016ef610d --- M Gemfile M Gemfile.lock A modules/ve-mw/tests/browser/features/media_general_settings.feature M modules/ve-mw/tests/browser/features/media_interface.feature M modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb M modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb 6 files changed, 47 insertions(+), 12 deletions(-) Approvals: Cmcmahon: Looks good to me, approved Ryasmeen: Looks good to me, approved jenkins-bot: Verified diff --git a/Gemfile b/Gemfile index ba0171c..f88eecd 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,6 @@ gem 'chunky_png' gem 'mediawiki_api' -gem 'mediawiki_selenium' +gem 'mediawiki_selenium', '~> 0.4.1' gem 'rspec' gem 'rubocop', require: false diff --git a/Gemfile.lock b/Gemfile.lock index b50ab79..97379f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -101,6 +101,6 @@ DEPENDENCIES chunky_png mediawiki_api - mediawiki_selenium + mediawiki_selenium (~> 0.4.1) rspec rubocop diff --git a/modules/ve-mw/tests/browser/features/media_general_settings.feature b/modules/ve-mw/tests/browser/features/media_general_settings.feature new file mode 100644 index 0000000..12e096a --- /dev/null +++ b/modules/ve-mw/tests/browser/features/media_general_settings.feature @@ -0,0 +1,27 @@ [email protected] @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]] | diff --git a/modules/ve-mw/tests/browser/features/media_interface.feature b/modules/ve-mw/tests/browser/features/media_interface.feature index 89dfa94..e846945 100644 --- a/modules/ve-mw/tests/browser/features/media_interface.feature +++ b/modules/ve-mw/tests/browser/features/media_interface.feature @@ -9,14 +9,12 @@ 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]] | diff --git a/modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb index ef54f6f..11dea2b 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb @@ -13,7 +13,15 @@ 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| diff --git a/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb b/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb index 5b9a865..56598ef 100644 --- a/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb +++ b/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb @@ -85,8 +85,10 @@ 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') @@ -121,10 +123,10 @@ 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)') -- To view, visit https://gerrit.wikimedia.org/r/187171 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic8a265678900ed52bbed6d90e971d6c016ef610d Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Ryasmeen <[email protected]> Gerrit-Reviewer: Cmcmahon <[email protected]> Gerrit-Reviewer: Ryasmeen <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
