Ryasmeen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/189610

Change subject: [BrowserTest][WIP] Fix Cite and Media test
......................................................................

[BrowserTest][WIP] Fix Cite and Media test

Change-Id: Icca92ad982bc1ef5735557600c03806a8708af4d
---
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
3 files changed, 8 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/10/189610/1

diff --git a/modules/ve-mw/tests/browser/features/media_interface.feature 
b/modules/ve-mw/tests/browser/features/media_interface.feature
index 52bb036..a83df71 100644
--- a/modules/ve-mw/tests/browser/features/media_interface.feature
+++ b/modules/ve-mw/tests/browser/features/media_interface.feature
@@ -13,8 +13,7 @@
       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
+    Then  diff view should show correct markup
   Examples:
-  | search_term           | expected_markup_text                               
                                      |
-  | bug                   | [[File:Folgers.ogv\|thughmb]]                      
                                       |
+  | search_term           |
+  | bug                   |
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 92cba22..ce70581 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
@@ -24,19 +24,11 @@
   on(VisualEditorPage).media_insert_button_element.when_present.click
 end
 
-Then(/^(.+) should appear in the media diff view$/) do |headings_string|
+Then(/^diff view should show correct markup$/) do
   on(VisualEditorPage) do |page|
-    # Contents pulled from the Cucumber tables in the .feature are escaped 
regexes.
-    # In this case we want unescaped regexes (and in one case a leading space)
-    # So we put single quotes around the entries in the .feature file and 
strip them here to get unescaped regexes.
-    headings_string = headings_string.gsub(/'/, '')
     page.wait_until(15) do
-      page.diff_view.include? 'Your text'
+      page.diff_view_element.exists?
     end
-    expect(page.diff_view).to match headings_string
+    expect(page.diff_view).to match /\[\[File:A Bug.JPG\|thumb\]\]/
   end
-end
-
-Then(/^I can click the X on the media save box$/) do
-  on(VisualEditorPage).media_exit_element.when_present.click
 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 f3b3323..70d3f25 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 @@
   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, css: '.ve-ui-mwReferenceGroupInputWidget 
.oo-ui-indicatorElement:nth-child(1) > input')
+  div(:cite_group_name_textarea, class: 'oo-ui-widget oo-ui-widget-enabled 
oo-ui-comboBoxWidget ve-ui-mwReferenceGroupInputWidget')
   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 @@
   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)
-  table(:diff_view, css: '.ve-ui-mwSaveDialog-viewer table.diff')
+  div(:diff_view, class: 've-ui-mwSaveDialog-viewer')
   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')

-- 
To view, visit https://gerrit.wikimedia.org/r/189610
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icca92ad982bc1ef5735557600c03806a8708af4d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Ryasmeen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to