[BrowserTest] refactor for alphabetization and space only

preliminary to updating Then statements to RSpec3.0 syntax

zero change to function or syntax, just arranging things so
we can review them later.

Change-Id: Id0f006d0fcf74010c06cb7ae6386ea6bcaff0e55
This commit is contained in:
Cmcmahon 2014-11-12 09:21:01 -07:00
parent 07ea50fa7b
commit 87bd220eed

View file

@ -1,9 +1,34 @@
Given(/^I close the VE information window$/) do
pending # express the regexp above with the code you wish you had
When(/^I click Bullets$/) do
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.ve_bullets_element.when_present.click
end
end
When(/^I type in an input string$/) do
When(/^I click Decrease indentation$/) do
on(VisualEditorPage) do |page|
sleep 2 #this is waiting for the Review Your Changes iframe to disappear
step "I click in the editable part"
page.bullet_number_selector_element.when_present(15).click
page.decrease_indentation_element.when_present.click
end
end
When(/^I click Increase indentation$/) do
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.increase_indentation_element.when_present.click
end
end
When(/^I click Numbering$/) do
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.ve_numbering_element.when_present.click
end
end
When(/^I type in an input string$/) do
on(VisualEditorPage) do |page|
#extra space after 'line' below is a workaround for FF issue where VE is sending BACKSPACE before RETURN
#probably caused by https://bugzilla.wikimedia.org/show_bug.cgi?id=56274
@ -12,19 +37,26 @@ end
end
end
When(/^select the string$/) do
require "watir-webdriver/extensions/select_text"
on(VisualEditorPage).content_element.select_text "This is a new line"
sleep 1 # turn the sleep on if this test fails with bullet/number in front of string NOT "This is.."
When(/^I undo Bullets$/) do
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.ve_bullets_element.when_present.click
end
end
When(/^I click Numbering$/) do
When(/^I undo Numbering$/) do
on(VisualEditorPage) do |page|
page.bullet_number_selector_element.when_present(15).click
page.ve_numbering_element.when_present.click
end
end
When(/^select the string$/) do
require "watir-webdriver/extensions/select_text"
on(VisualEditorPage).content_element.select_text "This is a new line"
sleep 1 # turn the sleep on if this test fails with bullet/number in front of string NOT "This is.."
end
Then(/^a \# is added in front of input string in the diff view$/) do
on(VisualEditorPage) do |page|
page.wait_until(10) do
@ -34,13 +66,6 @@ Then(/^a \# is added in front of input string in the diff view$/) do
end
end
When(/^I click Bullets$/) do
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
on(VisualEditorPage) do |page|
page.wait_until(10) do
@ -50,13 +75,6 @@ Then(/^a \* is added in front of input string in the diff view$/) do
end
end
When(/^I click Increase indentation$/) do
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
on(VisualEditorPage) do |page|
page.wait_until(10) do
@ -75,14 +93,20 @@ Then(/^a \*\* is added in front of input string in the diff view$/) do
end
end
Then(/^Decrease indentation should be enabled$/) do
on(VisualEditorPage).decrease_indentation_element.class_name.should_not match /disabled/
end
When(/^I click Decrease indentation$/) do
on(VisualEditorPage) do |page|
sleep 2 #this is waiting for the Review Your Changes iframe to disappear
step "I click in the editable part"
page.bullet_number_selector_element.when_present(15).click
page.decrease_indentation_element.when_present.click
end
Then(/^Decrease indentation should be disabled$/) do
on(VisualEditorPage).decrease_indentation_element.should_not be_visible
end
Then(/^Increase indentation should be enabled$/) do
on(VisualEditorPage).increase_indentation_element.class_name.should_not match /disabled/
end
Then(/^Increase indentation should be disabled$/) do
on(VisualEditorPage).increase_indentation_element.should_not be_visible
end
Then(/^nothing is added in front of input string in the diff view$/) do
@ -93,34 +117,3 @@ Then(/^nothing is added in front of input string in the diff view$/) do
page.review_failed_element.when_present.text.should match "No changes to review"
end
end
Then(/^Decrease indentation should be disabled$/) do
on(VisualEditorPage).decrease_indentation_element.should_not be_visible
end
Then(/^Increase indentation should be disabled$/) do
on(VisualEditorPage).increase_indentation_element.should_not be_visible
end
Then(/^Decrease indentation should be enabled$/) do
on(VisualEditorPage).decrease_indentation_element.class_name.should_not match /disabled/
end
Then(/^Increase indentation should be enabled$/) do
on(VisualEditorPage).increase_indentation_element.class_name.should_not match /disabled/
end
When(/^I undo Bullets$/) do
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) do |page|
page.bullet_number_selector_element.when_present(15).click
page.ve_numbering_element.when_present.click
end
end