Merge "[BrowserTest] updates for new bullets/indent UI"

This commit is contained in:
jenkins-bot 2014-05-29 17:38:11 +00:00 committed by Gerrit Code Review
commit a2d7668a01
2 changed files with 31 additions and 14 deletions

View file

@ -19,7 +19,10 @@ When(/^select the string$/) do
end
When(/^I click Numbering$/) do
on(VisualEditorPage).ve_numbering_element.when_present(15).click
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.ve_numbering_element.when_present.click
end
end
Then(/^a \# is added in front of input string in the diff view$/) do
@ -32,7 +35,10 @@ Then(/^a \# is added in front of input string in the diff view$/) do
end
When(/^I click Bullets$/) do
on(VisualEditorPage).ve_bullets_element.when_present(15).click
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.ve_bullets_element.when_present.click
end
end
Then(/^a \* is added in front of input string in the diff view$/) do
@ -45,7 +51,10 @@ Then(/^a \* is added in front of input string in the diff view$/) do
end
When(/^I click Increase indentation$/) do
on(VisualEditorPage).increase_indentation_on_element.when_present(15).click
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.increase_indentation_element.when_present.click
end
end
Then(/^a \#\# is added in front of input string in the diff view$/) do
@ -68,7 +77,11 @@ end
When(/^I click Decrease indentation$/) do
on(VisualEditorPage).decrease_indentation_on_element.when_present(15).click
on(VisualEditorPage) do |page|
sleep 2 #this is waiting for the Review Your Changes iframe to disappear
page.bullet_number_selector_element.when_present(15).click
page.decrease_indentation_element.when_present.click
end
end
Then(/^nothing is added in front of input string in the diff view$/) do
@ -81,26 +94,32 @@ Then(/^nothing is added in front of input string in the diff view$/) do
end
Then(/^Decrease indentation should be disabled$/) do
on(VisualEditorPage).decrease_indentation_element.should be_visible
on(VisualEditorPage).decrease_indentation_element.should_not be_visible
end
Then(/^Increase indentation should be disabled$/) do
on(VisualEditorPage).increase_indentation_element.should be_visible
on(VisualEditorPage).increase_indentation_element.should_not be_visible
end
Then(/^Decrease indentation should be enabled$/) do
on(VisualEditorPage).decrease_indentation_on_element.class_name.should_not match /disabled/
on(VisualEditorPage).decrease_indentation_element.class_name.should_not match /disabled/
end
Then(/^Increase indentation should be enabled$/) do
on(VisualEditorPage).increase_indentation_on_element.class_name.should_not match /disabled/
on(VisualEditorPage).increase_indentation_element.class_name.should_not match /disabled/
end
When(/^I undo Bullets$/) do
on(VisualEditorPage).ve_bullets_element.when_present(15).click
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.ve_bullets_element.when_present.click
end
end
When(/^I undo Numbering$/) do
on(VisualEditorPage).ve_numbering_element.when_present(15).click
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.ve_numbering_element.when_present.click
end
end

View file

@ -3,17 +3,15 @@ class VisualEditorPage
include URL
page_url URL.url("User:#{ENV['MEDIAWIKI_USER']}/#{ENV['BROWSER']}?vehidebetadialog=true&veaction=edit")
span(:bullet_number_selector, class: "oo-ui-iconedElement-icon oo-ui-icon-bullet-list")
div(:container_disabled, class: "oo-ui-widget oo-ui-widget-disabled oo-ui-flaggableElement-constructive oo-ui-.oo-ui-buttonedElement-framed")
div(:content, class: "ve-ce-branchNode")
span(:decrease_indentation, class: "oo-ui-iconedElement-icon oo-ui-icon-outdent-list")
a(:decrease_indentation_on, title: /Decrease indentation/)
span(:downarrow, class: "oo-ui-indicatedElement-indicator oo-ui-indicator-down")
a(:edit_ve, title: /Edit this page with VisualEditor/)
a(:edit_wikitext, title: /You can edit this page\./)
a(:heading, text: /Heading/)
span(:increase_indentation, class: "oo-ui-iconedElement-icon oo-ui-icon-indent-list")
a(:increase_indentation_on, title: /Increase indentation/)
span(:insert_menu, text: "Insert")
div(:insert_references, class: "oo-ui-window-title")
span(:internal_linksuggestion, text: "Main Page")
@ -42,7 +40,7 @@ class VisualEditorPage
end
span(:ve_bold_text, class: "oo-ui-iconedElement-icon oo-ui-icon-bold-b")
span(:ve_bullets, class: "oo-ui-iconedElement-icon oo-ui-icon-bullet-list")
span(:ve_bullets, class: "oo-ui-iconedElement-icon oo-ui-icon-bullet-list", index: 1)
span(:ve_computer_code, class: "oo-ui-iconedElement-icon oo-ui-icon-code")
div(:ve_heading_menu, class: "oo-ui-iconedElement-icon oo-ui-icon-down")
span(:ve_link_icon, class: "oo-ui-iconedElement-icon oo-ui-icon-link")