Change-Id: Id771991a89e1cf836c7f19083df22edb38ffc6c8
This commit is contained in:
cmcmahon 2013-10-08 16:38:04 -06:00
parent 6237dd1881
commit 46d14ca163
6 changed files with 24 additions and 27 deletions

View file

@ -22,9 +22,9 @@ end
Then(/^a \# is added in front of input string in the diff view$/) do
on(VisualEditorPage) do |page|
page.wait_until(10) do
page.heading_diff_view.include? '# This '
page.diff_view.include? '# This '
end
page.heading_diff_view.should match Regexp.new(/^\# This is a new line/)
page.diff_view.should match Regexp.new(/^\# This is a new line/)
end
end
@ -35,9 +35,9 @@ end
Then(/^a \* is added in front of input string in the diff view$/) do
on(VisualEditorPage) do |page|
page.wait_until(10) do
page.heading_diff_view.include? '* This '
page.diff_view.include? '* This '
end
page.heading_diff_view.should match Regexp.new(/^\* This is a new line/)
page.diff_view.should match Regexp.new(/^\* This is a new line/)
end
end
@ -48,18 +48,18 @@ end
Then(/^a \#\# is added in front of input string in the diff view$/) do
on(VisualEditorPage) do |page|
page.wait_until(10) do
page.heading_diff_view.include? '## This '
page.diff_view.include? '## This '
end
page.heading_diff_view.should match Regexp.new(/^\#\# This is a new line/)
page.diff_view.should match Regexp.new(/^\#\# This is a new line/)
end
end
Then(/^a \*\* is added in front of input string in the diff view$/) do
on(VisualEditorPage) do |page|
page.wait_until(10) do
page.heading_diff_view.include? '** This '
page.diff_view.include? '** This '
end
page.heading_diff_view.should match Regexp.new(/^\*\* This is a new line/)
page.diff_view.should match Regexp.new(/^\*\* This is a new line/)
end
end
@ -71,9 +71,9 @@ end
Then(/^nothing is added in front of input string in the diff view$/) do
on(VisualEditorPage) do |page|
page.wait_until(10) do
page.heading_diff_view.include? 'This '
page.diff_view.include? 'This '
end
page.heading_diff_view.should match Regexp.new(/^This is a new line/)
page.diff_view.should match Regexp.new(/^This is a new line/)
end
end

View file

@ -13,14 +13,14 @@ Then(/^(.+) should appear in the diff view$/) do |headings_string|
# So we put single quotes around the entries in the .feature file and strip them here to get unescaped regexes.
headings_string = headings_string.gsub(/'/, '')
page.wait_until(10) do
page.paragraph_diff_view.include? "Your text"
page.diff_view.include? "Your text"
end
page.paragraph_diff_view.should match Regexp.new(headings_string)
page.diff_view.should match Regexp.new(headings_string)
end
end
Then(/^I can click the up arrow on the save box$/) do
on(VisualEditorPage).uparrow_element.when_present.click
Then(/^I can click the X on the save box$/) do
on(VisualEditorPage).ex_element.when_present.click
end
When(/^I click Heading$/) do

View file

@ -30,9 +30,9 @@ end
Then(/^an internal link appears in the diff view$/) do
on(VisualEditorPage) do |page|
page.wait_until(10) do
page.internal_diff_view.include? 'Main Page'
page.diff_view.include? 'Main Page'
end
page.internal_diff_view.should match Regexp.escape('[[Main Page|Editing]]')
page.diff_view.should match Regexp.escape('[[Main Page|Editing]]')
end
end
@ -43,9 +43,9 @@ end
Then(/^a non\-existing link appears in the diff view$/) do
on(VisualEditorPage) do |page|
page.wait_until(10) do
page.internal_diff_view.include? 'DoesNotExist'
page.diff_view.include? 'DoesNotExist'
end
page.internal_diff_view.should match Regexp.escape('[[DoesNotExist|Editing]]')
page.diff_view.should match Regexp.escape('[[DoesNotExist|Editing]]')
end
end

View file

@ -49,4 +49,4 @@ end
Then(/^I should see the Apply changes button$/) do
on(VisualEditorPage).apply_changes_element.when_present.should be_visible
end
end

View file

@ -9,15 +9,12 @@ class VisualEditorPage
div(:container_disabled, class: 've-ui-widget ve-ui-widget-disabled ve-ui-flaggableElement-constructive ve-ui-pushButtonWidget')
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')
span(:downarrow, class: 've-ui-iconedElement-icon ve-ui-icon-down')
span(:heading, text: 'Heading')
a(:edit_ve, title: /Edit this page with VisualEditor/)
div(:heading_diff_view, class: 've-init-mw-viewPageTarget-saveDialog-viewer')
a(:increase_indentation, class: 've-ui-widget ve-ui-tool ve-ui-tool-indent ve-ui-widget-disabled')
a(:increase_indentation_on, title: 'Increase indentation [TAB]')
div(:insert_references, class: 've-ui-window-title')
div(:internal_diff_view, class: 've-init-mw-viewPageTarget-saveDialog-viewer')
span(:internal_linksuggestion, text: 'Main Page')
div(:ip_warning, class: 've-init-mw-viewPageTarget-toolbar-editNotices-notice')
span(:linksuggestion, text: 'http://www.example.com')
@ -27,16 +24,12 @@ class VisualEditorPage
span(:newpage_linksuggestion, text: 'DoesNotExist')
div(:page_text, id: 'mw-content-text')
span(:page_title, text: 'Page title')
div(:paragraph_diff_view, class: 've-init-mw-viewPageTarget-saveDialog-viewer')
span(:paragraph, text: 'Paragraph')
span(:preformatted, text: 'Preformatted')
span(:refs_link, text: 'Reference')
span(:return_to_save, class: 've-ui-labeledElement-label', text: 'Return to save form')
span(:review_changes, class: 've-ui-labeledElement-label', text: 'Review your changes')
div(:save_disabled, class: 've-ui-widget ve-ui-widget-disabled ve-ui-flaggableElement-constructive ve-ui-pushButtonWidget')
span(:save_page, class: 've-ui-labeledElement-label', text: 'Save page')
span(:second_save_page, class: 've-ui-labeledElement-label', text: 'Save page', index: 1)
div(:uparrow, class:'ve-init-mw-viewPageTarget-saveDialog-closeButton')
span(:ve_bullets, class: 've-ui-iconedElement-icon ve-ui-icon-bullet-list')
div(:ve_heading_menu, class: 've-ui-dropdownTool-icon ve-ui-icon-down')
span(:ve_heading_ui, text: 'Paragraph')
@ -49,6 +42,8 @@ class VisualEditorPage
in_frame(:index => 0) do |frame|
div(:content_box, class: 've-ce-documentNode ve-ce-branchNode', frame: frame)
span(:create_new, text:'Insert reference', frame: frame)
div(:diff_view, class: 've-ui-mwSaveDialog-viewer', frame: frame)
a(:ex, title: 'Close', frame: frame)
span(:heading, text: 'Heading')
div(:insert_reference, text: 'Insert reference', frame: frame)
a(:leftarrowclose, class: 've-ui-widget ve-ui-iconButtonWidget ve-ui-icon-previous ve-ui-inspector-closeButton', frame: frame)
@ -56,7 +51,9 @@ class VisualEditorPage
span(:paragraph, text: 'Paragraph')
span(:preformatted, text: 'Preformatted')
span(:page_title, text: 'Page title')
span(:review_changes, class: 've-ui-labeledElement-label', text: 'Review your changes', frame: frame)
div(:ref_body, class:'ve-ui-window-head', frame: frame)
span(:return_to_save, class: 've-ui-labeledElement-label', text: 'Return to save form', frame: frame)
div(:ve_link_ui, class: 've-ui-window-head', frame: frame)
span(:subheading1, text: 'Sub-heading 1')
span(:subheading2, text: 'Sub-heading 2')

View file

@ -8,7 +8,7 @@ Feature: VisualEditor Headings
And I click Save page
And I click Review your changes
Then <headings_string> should appear in the diff view
And I can click the up arrow on the save box
And I can click the X on the save box
Examples:
| headings_interface_name | headings_string |
| Paragraph | '^Editing' |