Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/81241
Change subject: WIP Refactor VE headings scenarios ...................................................................... WIP Refactor VE headings scenarios Merged, then reverted. Here is it ready to be merged again. Change-Id: I3a19e7ffdf7289e7a453b4771c849233eea31131 --- M features/step_definitions/page_steps.rb M features/step_definitions/visual_editor_headings_steps.rb M features/support/pages/visual_editor_page.rb M features/visual_editor_headings.feature 4 files changed, 118 insertions(+), 39 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests refs/changes/41/81241/1 diff --git a/features/step_definitions/page_steps.rb b/features/step_definitions/page_steps.rb index 92cb91a..bac0d26 100644 --- a/features/step_definitions/page_steps.rb +++ b/features/step_definitions/page_steps.rb @@ -130,4 +130,4 @@ page.body_content.should match(/Moved/) page.body_content.should_not match(/Redirect page/) end -end \ No newline at end of file +end diff --git a/features/step_definitions/visual_editor_headings_steps.rb b/features/step_definitions/visual_editor_headings_steps.rb index c4e24af..ec5f764 100644 --- a/features/step_definitions/visual_editor_headings_steps.rb +++ b/features/step_definitions/visual_editor_headings_steps.rb @@ -1,12 +1,4 @@ -When(/^I click the Headings pull\-down menu$/) do - on(VisualEditorPage).ve_heading_menu_element.when_present.click - end - -Given(/^I can see the Headings interface$/) do - on(VisualEditorPage).ve_heading_ui.should match Regexp.escape('Paragraph') -end - -When(/^I click the down arrow$/) do +When(/^I click the down arrow on Headings interface$/) do on(VisualEditorPage).downarrow_element.when_present.click end @@ -21,6 +13,10 @@ end page.paragraph_diff_view.should match Regexp.escape('Editing with ') end +end + +Then(/^I should be able to click the up arrow on the save box$/) do + on(VisualEditorPage).uparrow_element.when_present.click end When(/^I click Heading$/) do @@ -62,3 +58,54 @@ end end +When(/^I click Sub\-Heading3$/) do + on(VisualEditorPage).subheading3_element.when_present.click +end + +Then(/^a sub\-heading3 should appear in the diff view$/) do + on(VisualEditorPage) do |page| + page.wait_until(10) do + page.heading_diff_view.include? '=====Editing ' + end + page.heading_diff_view.should match Regexp.escape('=====Editing with ') + end +end + +When(/^I click Sub\-Heading4$/) do + on(VisualEditorPage).subheading4_element.when_present.click +end + +Then(/^a sub\-heading4 should appear in the diff view$/) do + on(VisualEditorPage) do |page| + page.wait_until(10) do + page.heading_diff_view.include? '======Editing ' + end + page.heading_diff_view.should match Regexp.escape('======Editing with ') + end +end + +When(/^I click Preformatted$/) do + on(VisualEditorPage).preformatted_element.when_present.click +end + +Then(/^a Preformatted should appear in the diff view$/) do + on(VisualEditorPage) do |page| + page.wait_until(10) do + page.heading_diff_view.include? ' Editing ' + end + page.heading_diff_view.should match Regexp.escape(' Editing with ') + end +end + + When(/^I click Page title$/) do + on(VisualEditorPage).page_title_element.when_present.click +end + +Then(/^a Page title should appear in the diff view$/) do + on(VisualEditorPage) do |page| + page.wait_until(10) do + page.heading_diff_view.include? '=Editing ' + end + page.heading_diff_view.should match Regexp.escape('=Editing with ') + end +end diff --git a/features/support/pages/visual_editor_page.rb b/features/support/pages/visual_editor_page.rb index 9fa0d56..e6ee578 100644 --- a/features/support/pages/visual_editor_page.rb +++ b/features/support/pages/visual_editor_page.rb @@ -8,6 +8,7 @@ div(:content, class: 've-ce-documentNode ve-ce-branchNode') text_area(:describe_change, id: 've-init-mw-viewPageTarget-saveDialog-editSummary') div(:diff_view, class: 've-init-mw-viewPageTarget-saveDialog-viewer') + div(:downarrow, class: 've-ui-dropdownTool-icon ve-ui-icon-down') a(:edit_ve, text: 'Edit') div(:heading_diff_view, class: 've-init-mw-viewPageTarget-saveDialog-viewer') div(:insert_references, class: 've-ui-window-title') @@ -35,7 +36,6 @@ span(:apply_changes, text: 'Apply changes', frame: frame) text_field(:content_box, index: 0, frame: frame) span(:create_new, text:'Insert reference', frame: frame) - div(:downarrow, class: 've-ui-dropdownTool-icon ve-ui-icon-down') span(:heading, text: 'Heading') div(:insert_reference, class: 've-ui-widget ve-ui-flaggableElement-primary ve-ui-buttonWidget ve-ui-window-applyButton', frame: frame) a(:leftarrowclose, class: 've-ui-widget ve-ui-iconButtonWidget ve-ui-icon-previous ve-ui-inspector-closeButton', frame: frame) @@ -44,16 +44,21 @@ span(:newpage_linksuggestion, text: 'DoesNotExist') text_field(:parameter_box, index: 0, frame: frame) span(:paragraph, text: 'Paragraph') + span(:preformatted, text: 'Preformatted') + span(:page_title, text: 'Page title') div(:ref_body, class:'ve-ui-window-head', frame: frame) div(:ve_link_ui, class: 've-ui-window-head', frame: frame) span(:remove_parameter, text: 'Remove parameter', frame: frame) span(:remove_template, text: 'Remove template', frame: frame) span(:subheading1, text: 'Sub-heading 1') span(:subheading2, text: 'Sub-heading 2') + span(:subheading3, text: 'Sub-heading 3') + span(:subheading4, text: 'Sub-heading 4') unordered_list(:suggestion_list, class: 've-ui-widget ve-ui-selectWidget ve-ui-menuWidget ve-ui-textInputMenuWidget ve-ui-lookupWidget-menu ve-ui-mwTitleInputWidget-menu', frame: frame) list_item(:template_list_item, text: 'S', frame: frame) div(:title, class: 've-ui-window-title', frame: frame) text_area(:transclusion_textarea, index: 0, frame: frame) + div(:uparrow, class:'ve-init-mw-viewPageTarget-saveDialog-closeButton') span(:ve_heading_ui, text: 'Paragraph') end end diff --git a/features/visual_editor_headings.feature b/features/visual_editor_headings.feature index 2eeb536..1857189 100644 --- a/features/visual_editor_headings.feature +++ b/features/visual_editor_headings.feature @@ -1,48 +1,75 @@ @ie6-bug @ie7-bug @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org @login Feature: VisualEditor Headings - Background: + Background: Open VE and edit page with string Given I am logged in And I am at my user page - When I click Edit for VisualEditor - And I click the Headings pull-down menu + And I click Edit for VisualEditor + When I edit the page with a string + And I click the down arrow on Headings interface - Scenario: Choose Paragraph - Given I can see the Headings interface - When I edit the page with a string - And I click the down arrow - And I click Paragraph - And I click Save page - And I click Review your changes + Scenario: Choose Paragraph Heading + When I click Paragraph + And I click Save page + And I click Review your changes Then a paragraph should appear in the diff view - Scenario: Choose Heading - Given I can see the Headings interface - When I edit the page with a string - And I click the down arrow - And I click Heading + Scenario: Choose Heading Headinge + When I click Heading + And I click Save page + And I click Review your changes + Then a heading should appear in the diff view + + Scenario: Choose Subheading1 Heading + When I click Sub-Heading1 And I click Save page And I click Review your changes - Then a heading should appear in the diff view + Then a sub-heading1 should appear in the diff view - Scenario: Choose Sub-Heading1 - Given I can see the Headings interface - When I edit the page with a string - And I click the down arrow - And I click Sub-Heading1 - And I click Save page - And I click Review your changes - Then a sub-heading1 should appear in the diff view - - Scenario: Choose Sub-Heading2 - Given I can see the Headings interface + #Scenario: Choose Sub-Heading2 Heading When I edit the page with a string - And I click the down arrow + And I click the down arrow on Headings interface And I click Sub-Heading2 And I click Save page And I click Review your changes Then a sub-heading2 should appear in the diff view + And I should be able to click the up arrow on the save box + # Scenario: Choose Sub-Heading3 Heading + When I edit the page with a string + And I click the down arrow on Headings interface + And I click Sub-Heading3 + And I click Save page + And I click Review your changes + Then a sub-heading3 should appear in the diff view + And I should be able to click the up arrow on the save box + + #Scenario: Choose Sub-Heading4 Heading + When I edit the page with a string + And I click the down arrow on Headings interface + And I click Sub-Heading4 + And I click Save page + And I click Review your changes + Then a sub-heading4 should appear in the diff view + And I should be able to click the up arrow on the save box + + # Scenario: Choose Preformatted Heading + When I edit the page with a string + And I click the down arrow on Headings interface + And I click Preformatted + And I click Save page + And I click Review your changes + Then a Preformatted should appear in the diff view + And I should be able to click the up arrow on the save box + + # Scenario: Choose Page title Heading + When I edit the page with a string + And I click the down arrow on Headings interface + And I click Page title + And I click Save page + And I click Review your changes + Then a Page title should appear in the diff view + And I should be able to click the up arrow on the save box -- To view, visit https://gerrit.wikimedia.org/r/81241 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3a19e7ffdf7289e7a453b4771c849233eea31131 Gerrit-PatchSet: 1 Gerrit-Project: qa/browsertests Gerrit-Branch: master Gerrit-Owner: Cscott <canan...@wikimedia.org> Gerrit-Reviewer: Rachel99 <rachelq...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits