jenkins-bot has submitted this change and it was merged.

Change subject: [BrowserTest] update switch-edit-mode test for new UI
......................................................................


[BrowserTest] update switch-edit-mode test for new UI

Also add new checks for switch-modal Discard and
Cancel options

Change-Id: I228b0dee1d110f6a72be4966bbc5918f294ab717
---
M 
modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb
M modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb
M modules/ve-mw/tests/browser/features/switch_editing_mode.feature
3 files changed, 15 insertions(+), 3 deletions(-)

Approvals:
  Cmcmahon: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb
 
b/modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb
index 42d429c..d17aa6b 100644
--- 
a/modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb
+++ 
b/modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb
@@ -1,4 +1,4 @@
-When(/^I clear the confirm dialog$/) do
+When(/^I clear the confirm dialog by clicking Keep changes$/) do
   on(VisualEditorPage).confirm_switch_element.when_present.click
 end
 
@@ -26,6 +26,14 @@
   end
 end
 
+When(/^I see the Cancel option$/) do
+  on(VisualEditorPage).confirm_switch_cancel_element.when_present
+end
+
+When(/^I see the Discard option$/) do
+  on(VisualEditorPage).confirm_switch_discard_element.when_present
+end
+
 When(/^I see the wikitext editor$/) do
   on(VisualEditorPage).wikitext_editor_element.when_present(10).should 
be_visible
 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 7cc0a18..9f226f3 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
@@ -76,7 +76,9 @@
     span(:add_parameter, text: "Add more information", frame: frame)
     span(:add_template, text: "Add template", frame: frame)
     span(:insert_template, text: "Insert template", frame: frame)
-    a(:confirm_switch, css: "div.oo-ui-widget:nth-child(1) > a:nth-child(1) > 
span:nth-child(2)", frame: frame)
+    span(:confirm_switch, text: "Keep changes", frame: frame)
+    span(:confirm_switch_cancel, text: "Cancel", frame: frame)
+    span(:confirm_switch_discard, text: "Discard changes", frame: frame)
     div(:content_box, class: "ve-ce-documentNode ve-ce-branchNode", frame: 
frame)
     text_area(:describe_change, index: 0, frame: frame)
     div(:diff_view, class: "ve-ui-mwSaveDialog-viewer", frame: frame)
diff --git a/modules/ve-mw/tests/browser/features/switch_editing_mode.feature 
b/modules/ve-mw/tests/browser/features/switch_editing_mode.feature
index 2074c4e..00784ac 100644
--- a/modules/ve-mw/tests/browser/features/switch_editing_mode.feature
+++ b/modules/ve-mw/tests/browser/features/switch_editing_mode.feature
@@ -15,7 +15,9 @@
 
   Scenario: Switch editing modes via Page Settings drop-down menu
     When I click the Switch to source editing menu option
-      And I clear the confirm dialog
+      And I see the Cancel option
+      And I see the Discard option
+      And I clear the confirm dialog by clicking Keep changes
       And I see the wikitext editor
       And I click Edit for VisualEditor from this page
     Then I should be in Visual Editor editing alternate mode

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I228b0dee1d110f6a72be4966bbc5918f294ab717
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to