Ryasmeen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/178741
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, 52 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/41/178741/1
diff --git a/modules/ve-mw/tests/browser/features/options.feature
b/modules/ve-mw/tests/browser/features/options.feature
index 5d8470d..f730302 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..d8f0ad4 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
@@ -66,3 +66,36 @@
expect(page.diff_view).to match /{{DISPLAYTITLE:automated test}}.+Options
VisualEditor Test.+__INDEX__.+__NEWSECTIONLINK__/m
end
end
+
+When(/^I check the option for Redirect this page to$/) do
+ on(VisualEditorPage).check_option_to_redirect_the_page
+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
+
+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 select the option Always for showing Table of Contents$/) do
+ on(VisualEditorPage).option_to_always_show_TOC_element.when_present.click
+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 This is a Disambiguation page$/) do
+ on(VisualEditorPage).check_option_to_refer_as_disambiguation_page
+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..0873a57 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: newchange
Gerrit-Change-Id: I31d8d3327bd8abe6a7c5f3c4941174253104bbac
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