[BrowserTest] updates for new bullets/indent UI

DONE: bullets test passes in Firefox and Chrome
DONE: indent/outdent test passes in Firefox and Chrome

TODO: instead of sleep do wait_until for the iframe

Change-Id: Ibcda64dc2457648abf3d5c6bc226b5cc628c0c45
This commit is contained in:
Cmcmahon 2014-05-29 09:11:47 -07:00
parent 9e522c638b
commit 26a5d50b6e
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")