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

Change subject: [BrowserTest] Adding tests for checking fields under Page 
Settings
......................................................................


[BrowserTest] Adding tests for checking fields under Page Settings

Change-Id: I31d8d3327bd8abe6a7c5f3c4941174253104bbac
---
M modules/ve-mw/tests/browser/features/options.feature
M modules/ve-mw/tests/browser/features/step_definitions/options_steps.rb
M modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb
3 files changed, 72 insertions(+), 20 deletions(-)

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



diff --git a/modules/ve-mw/tests/browser/features/options.feature 
b/modules/ve-mw/tests/browser/features/options.feature
index 82db17a..1531c28 100644
--- a/modules/ve-mw/tests/browser/features/options.feature
+++ b/modules/ve-mw/tests/browser/features/options.feature
@@ -35,3 +35,16 @@
       And I click Save page
       And I click Review your changes
     Then the options set in Advanced Settings panel should appear in diff view
+
+  Scenario: Setting the fields in Page Settings
+   When I click Page Settings
+     And I check the option for Redirect this page to
+     And I type "Linux" for redirect page
+     And I check the option for Prevent this redirect being updated when 
target page is moved
+     And I select the option Always for showing Table of Contents
+     And I check the option for Disable edit links next to each heading on 
this page
+     And I check the option for This is a Disambiguation page
+     And I click Apply Changes button
+     And I click Save page
+     And I click Review your changes
+   Then the options set in Page Settings panel should appear in diff view
diff --git 
a/modules/ve-mw/tests/browser/features/step_definitions/options_steps.rb 
b/modules/ve-mw/tests/browser/features/step_definitions/options_steps.rb
index 33f0058..2f5d863 100644
--- a/modules/ve-mw/tests/browser/features/step_definitions/options_steps.rb
+++ b/modules/ve-mw/tests/browser/features/step_definitions/options_steps.rb
@@ -1,5 +1,29 @@
+When(/^I check the option for Enable display title$/) do
+  on(VisualEditorPage).check_option_to_enable_display_title
+end
+
+When(/^I check the option for Disable edit links next to each heading on this 
page$/) do
+  on(VisualEditorPage).check_option_to_disable_edit_links
+end
+
+When(/^I check the option for Prevent this redirect being updated when target 
page is moved$/) do
+  on(VisualEditorPage).check_option_to_prevent_redirect_being_updated
+end
+
+When(/^I check the option for Redirect this page to$/) do
+  on(VisualEditorPage).check_option_to_redirect_the_page
+end
+
+When(/^I check the option for This is a Disambiguation page$/) do
+  on(VisualEditorPage).check_option_to_refer_as_disambiguation_page
+end
+
 When(/^I click Advanced Settings$/) do
   on(VisualEditorPage).option_advanced_settings_element.when_present.click
+end
+
+When(/^I click Apply Changes button$/) do
+  on(VisualEditorPage).apply_changes_button_element.when_present.click
 end
 
 When(/^I click Categories$/) do
@@ -18,8 +42,28 @@
   on(VisualEditorPage).hamburger_menu_element.when_present.click
 end
 
+When(/^I click Yes for Indexed by Search Engines$/) do
+  on(VisualEditorPage).option_to_set_index_by_search_element.when_present.click
+end
+
+When(/^I click Yes for showing tab for adding new section$/) do
+  
on(VisualEditorPage).option_to_show_new_section_tab_element.when_present.click
+end
+
 When(/^I see options overlay$/) do
   on(VisualEditorPage).options_page_title_element.when_present
+end
+
+When(/^I select the option Always for showing Table of Contents$/) do
+  on(VisualEditorPage).option_to_always_show_TOC_element.when_present.click
+end
+
+When(/^I type "(.*?)" for display title textbox$/) do |display_title_text|
+  
on(VisualEditorPage).display_title_textbox_element.when_present.send_keys(display_title_text)
+end
+
+When(/^I type "(.*?)" for redirect page$/) do |redirect_page_name|
+  
on(VisualEditorPage).redirect_page_name_textbox_element.when_present.send_keys(redirect_page_name)
 end
 
 Then(/^I should see the options overlay$/) do
@@ -38,26 +82,6 @@
   
expect(on(VisualEditorPage).options_settings_content_page_settings_element).to 
be_visible
 end
 
-When(/^I click Yes for Indexed by Search Engines$/) do
-  on(VisualEditorPage).option_to_set_index_by_search_element.when_present.click
-end
-
-When(/^I click Yes for showing tab for adding new section$/) do
-  
on(VisualEditorPage).option_to_show_new_section_tab_element.when_present.click
-end
-
-When(/^I check the option for Enable display title$/) do
-  on(VisualEditorPage).check_option_to_enable_display_title
-end
-
-When(/^I type "(.*?)" for display title textbox$/) do |display_title_text|
-  
on(VisualEditorPage).display_title_textbox_element.when_present.send_keys(display_title_text)
-end
-
-When(/^I click Apply Changes button$/) do
-  on(VisualEditorPage).apply_changes_button_element.when_present.click
-end
-
 Then(/^the options set in Advanced Settings panel should appear in diff 
view$/) do
   on(VisualEditorPage) do |page|
     page.wait_until(10) do
@@ -66,3 +90,12 @@
     expect(page.diff_view).to match /{{DISPLAYTITLE:automated test}}.+Options 
VisualEditor Test.+__INDEX__.+__NEWSECTIONLINK__/m
   end
 end
+
+Then(/^the options set in Page Settings panel should appear in diff view$/) do
+  on(VisualEditorPage) do |page|
+    page.wait_until(10) do
+      page.diff_view.include? 'Linux'
+    end
+    expect(page.diff_view).to match /#REDIRECT \[\[Linux\]\]Options 
VisualEditor 
Test.+__FORCETOC__.+__STATICREDIRECT__.+__NOEDITSECTION__.+__DISAMBIG__/m
+  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 9ffc99b..3496c9c 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
@@ -40,12 +40,14 @@
   span(:confirm_switch_cancel, text: 'Resume editing')
   span(:confirm_switch_cancel_on_switch, text: 'Cancel')
   span(:confirm_switch_discard, text: 'Discard changes')
+  span(:option_to_always_show_TOC, css: 'div.oo-ui-fieldLayout:nth-child(4) > 
div:nth-child(3) > div:nth-child(1) > div:nth-child(1) > a:nth-child(1) > 
span:nth-child(2)')
   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')
   div(:disabled_save_button, class: 'oo-ui-widget oo-ui-widget-disabled 
oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement 
oo-ui-flaggedElement-constructive oo-ui-buttonWidget ve-ui-toolbar-saveButton')
   text_field(:display_title_textbox, css: 'label.oo-ui-layout:nth-child(4) > 
div:nth-child(1) > div:nth-child(1) > input:nth-child(1)')
+  text_field(:redirect_page_name_textbox, css: '.oo-ui-flaggedElement-invalid 
> input:nth-child(1)')
   span(:downarrow, class: 'oo-ui-indicatorElement-indicator 
oo-ui-indicator-down')
   a(:edit_ve, title: /Edit this page with VisualEditor/)
   a(:edit_wikitext, title: /You can edit this page\./)
@@ -93,6 +95,10 @@
   div(:options_settings_content_categories, class: 'oo-ui-layout 
oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout', text: /Categories/)
   div(:options_settings_content_page_settings, class: 'oo-ui-layout 
oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout', text: /Page 
settings/)
   checkbox(:option_to_enable_display_title, index: 4)
+  checkbox(:option_to_redirect_the_page, index: 0)
+  checkbox(:option_to_prevent_redirect_being_updated, index: 1)
+  checkbox(:option_to_disable_edit_links, index: 2)
+  checkbox(:option_to_refer_as_disambiguation_page, index: 3)
   span(:option_to_set_index_by_search, class: 'oo-ui-labelElement-label', 
text: 'Yes', index: 0)
   span(:option_to_show_new_section_tab, class: 'oo-ui-labelElement-label', 
text: 'Yes', index: 1)
   div(:page_option_menu, class: 'oo-ui-toolGroup-tools 
oo-ui-clippableElement-clippable', index: 6)

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

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

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

Reply via email to