jenkins-bot has submitted this change and it was merged.

Change subject: [BrowserTest] refactor for alphabetization and space only
......................................................................


[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
---
M modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb
1 file changed, 54 insertions(+), 61 deletions(-)

Approvals:
  Cmcmahon: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb 
b/modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb
index 4d76e0e..7c2ee42 100644
--- a/modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb
+++ b/modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb
@@ -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,17 +37,24 @@
   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
@@ -34,26 +66,12 @@
   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
       page.diff_view.include? "* #{@wikitext}"
     end
     page.diff_view.should match Regexp.new(/^\* #{@wikitext}/)
-  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
 
@@ -75,14 +93,20 @@
   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
@@ -91,36 +115,5 @@
       page.review_failed_element.when_present.text.include? "No changes to 
review"
     end
     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

-- 
To view, visit https://gerrit.wikimedia.org/r/172758
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id0f006d0fcf74010c06cb7ae6386ea6bcaff0e55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to