jenkins-bot has submitted this change and it was merged.
Change subject: [Browsertest]Tests for options under Advanced Settings panel
......................................................................
[Browsertest]Tests for options under Advanced Settings panel
Change-Id: I21765e9e3d7a004d24dd620dd0da35978632d02a
---
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, 46 insertions(+), 1 deletion(-)
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 8dc901b..5d8470d 100644
--- a/modules/ve-mw/tests/browser/features/options.feature
+++ b/modules/ve-mw/tests/browser/features/options.feature
@@ -23,4 +23,15 @@
Scenario: Categories
When I click Categories
Then I should see the options overlay
- And the options overlay should display Categories
\ No newline at end of file
+ And the options overlay should display Categories
+
+ Scenario: Advanced Settings setting fields
+ When I click Advanced Settings
+ And I click Yes for Indexed by Search Engines
+ And I click Yes for showing tab for adding new section
+ And I check the option for Enable display title
+ And I type "automated test" for display title textbox
+ And I click Apply Changes button
+ And I click Save page
+ And I click Review your changes
+ Then the options set in Advanced 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 baa1af7..33f0058 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
@@ -37,3 +37,32 @@
Then(/^the options overlay should display Page Settings$/) do
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
+ page.diff_view.include? 'automated test'
+ end
+ expect(page.diff_view).to match /{{DISPLAYTITLE:automated test}}.+Options
VisualEditor Test.+__INDEX__.+__NEWSECTIONLINK__/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 5470d80..17a5a23 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
@@ -6,6 +6,7 @@
div(:add_a_template_title, class: 'oo-ui-processDialog-location', text: /Add
a template/)
span(:add_template, text: 'Add template')
+ span(:apply_changes_button, text: 'Apply changes')
span(:basic_reference, class: 'oo-ui-iconElement-icon oo-ui-icon-reference')
span(:bullet_number_selector, class: 'oo-ui-iconElement-icon
oo-ui-icon-bullet-list')
span(:category_link, class: 'oo-ui-iconElement-icon oo-ui-icon-tag')
@@ -44,6 +45,7 @@
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)')
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\./)
@@ -90,6 +92,9 @@
div(:options_settings_content_advanced, class: 'oo-ui-layout
oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout', text: /Advanced
settings/)
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)
+ 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)
span(:page_settings, class: 'oo-ui-iconElement-icon oo-ui-icon-settings')
label(:page_settings_editlinks, class: 'oo-ui-layout oo-ui-labelElement
oo-ui-fieldLayout oo-ui-fieldLayout-align-inline', index: 4)
--
To view, visit https://gerrit.wikimedia.org/r/175589
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I21765e9e3d7a004d24dd620dd0da35978632d02a
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Ryasmeen <[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