diff --git a/modules/ve-mw/tests/browser/features/cite.feature b/modules/ve-mw/tests/browser/features/cite.feature index d32b5b7d61..e9ffffe153 100644 --- a/modules/ve-mw/tests/browser/features/cite.feature +++ b/modules/ve-mw/tests/browser/features/cite.feature @@ -84,6 +84,7 @@ Feature: VisualEditor Cite Then I should see the VisualEditor interface And I should see the Options use this group text And I should see the General references + #And I fill in General references Scenario: Error message for required field not present When I click Journal diff --git a/modules/ve-mw/tests/browser/features/media_general_settings.feature b/modules/ve-mw/tests/browser/features/media_general_settings.feature index be57b5ae2f..5a1ed406c5 100644 --- a/modules/ve-mw/tests/browser/features/media_general_settings.feature +++ b/modules/ve-mw/tests/browser/features/media_general_settings.feature @@ -5,9 +5,9 @@ Feature: VisualEditor Media Interface 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 + Scenario: VisualEditor insert new media Given I click Media - And I enter into media Search box + And I enter bug into media Search box And I select an Image And I click Use this image And I fill up the Caption field with "caption" @@ -15,8 +15,4 @@ Feature: VisualEditor Media Interface And I click Insert And I click Save page And I click Review your changes - Then should appear in the media diff view - And I can click the X on the media save box - Examples: - | search_term | expected_markup_text | - | duck | [[File:Ducks take off 444 720p25.ogg\|alt=alt text\|thumb\|caption]] | \ No newline at end of file + Then diff view should show media file with caption and alt text diff --git a/modules/ve-mw/tests/browser/features/media_interface.feature b/modules/ve-mw/tests/browser/features/media_interface.feature index e846945ba4..52bb036855 100644 --- a/modules/ve-mw/tests/browser/features/media_interface.feature +++ b/modules/ve-mw/tests/browser/features/media_interface.feature @@ -17,4 +17,4 @@ Feature: VisualEditor Media Interface And I can click the X on the media save box Examples: | search_term | expected_markup_text | - | bug | [[File:Folgers.ogv\|thumb]] | + | bug | [[File:Folgers.ogv\|thughmb]] | diff --git a/modules/ve-mw/tests/browser/features/step_definitions/media_general_settings_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/media_general_settings_steps.rb index 5d1ada9bd2..2a264ea39c 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/media_general_settings_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/media_general_settings_steps.rb @@ -1,7 +1,16 @@ -Given(/^I fill up the Caption field with "(.*?)"$/) do |first_string| - on(VisualEditorPage).caption_element.when_present.send_keys (first_string) +Given(/^I fill up the Caption field with "(.*?)"$/) do |caption_text| + on(VisualEditorPage).caption_element.when_present.send_keys caption_text end -Given(/^I fill up the Alternative text with "(.*?)"$/) do |second_string| - on(VisualEditorPage).alternative_text_element.when_present.send_keys (second_string) +Given(/^I fill up the Alternative text with "(.*?)"$/) do |alt_text| + on(VisualEditorPage).alternative_text_element.when_present.send_keys alt_text +end + +Then(/^diff view should show media file with caption and alt text$/) do + on(VisualEditorPage) do |page| + page.wait_until(15) do + page.diff_view_element.exists? + end + expect(page.diff_view).to match /\[\[File:A Bug.JPG\|alt=alt text\|thumb\|caption\]\]/ + end end 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 5384bf3041..f3b3323e8e 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 @@ -24,7 +24,7 @@ class VisualEditorPage a(:cite_book, css: '.oo-ui-tool-name-cite-book > a:nth-child(1)') span(:cite_button, css: '.ve-test-toolbar-cite .oo-ui-labelElement-label') text_field(:cite_custom_field_name, css: '.oo-ui-searchWidget-query > div:nth-child(1) > input:nth-child(1)') - div(:cite_group_name_textarea, class: 'oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-indicatorElement oo-ui-textInputWidget') + div(:cite_group_name_textarea, css: '.ve-ui-mwReferenceGroupInputWidget .oo-ui-indicatorElement:nth-child(1) > input') a(:cite_journal, css: '.oo-ui-tool-name-cite-journal > a:nth-child(1)') span(:cite_indicator_down, css: '.ve-test-toolbar-cite .oo-ui-indicator-down') div(:cite_new_field_label, css: '.oo-ui-optionWidget') @@ -44,7 +44,7 @@ class VisualEditorPage div(:content, class: 've-ce-branchNode') span(:decrease_indentation, class: 'oo-ui-iconElement-icon oo-ui-icon-outdent-list') text_area(:describe_change, index: 0) - div(:diff_view, class: 've-ui-mwSaveDialog-viewer') + table(:diff_view, css: '.ve-ui-mwSaveDialog-viewer table.diff') div(:disabled_save_button, css: 'div.ve-init-mw-viewPageTarget-toolbar-actions > div.oo-ui-flaggedElement-progressive.oo-ui-widget-disabled') text_field(:display_title_textbox, css: 'div.oo-ui-fieldLayout-align-inline:nth-child(4) > label:nth-child(1) > div:nth-child(1) > div:nth-child(1) > input:nth-child(1)') div(:enable_redirect, class: 've-test-page-settings-enable-redirect') @@ -92,8 +92,8 @@ class VisualEditorPage 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)') - div(:caption, css: 'div.ve-ui-surface:nth-child(2)') - div(:alternative_text, css: 'div.oo-ui-inputWidget:nth-child(4)') + div(:caption, css: 'div.ve-ui-surface:nth-child(2) > div:nth-child(1) > div.ve-ce-documentNode.ve-ce-branchNode') + text_field(:alternative_text, css: '.oo-ui-textInputWidget.ve-ui-mwMediaDialog-altText > input') checkbox(:minor_edit, id: 'wpMinoredit') div(:no_unused_fields, text: 'No unused fields') a(:new_link, class: 've-ce-linkAnnotation ve-ce-mwInternalLinkAnnotation new')