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

Change subject: refactor to use Scenario Outline and REUSE_BROWSER env var
......................................................................


refactor to use Scenario Outline and REUSE_BROWSER env var

Change-Id: I65970c0df35bcac48f16899090cadc8df8c560c6
---
M modules/ve-mw/test/browser/features/support/hooks.rb
M modules/ve-mw/test/browser/features/visual_editor_bullets.feature
M modules/ve-mw/test/browser/features/visual_editor_indent_outdent.feature
3 files changed, 55 insertions(+), 69 deletions(-)

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



diff --git a/modules/ve-mw/test/browser/features/support/hooks.rb 
b/modules/ve-mw/test/browser/features/support/hooks.rb
index f59f070..77a7077 100644
--- a/modules/ve-mw/test/browser/features/support/hooks.rb
+++ b/modules/ve-mw/test/browser/features/support/hooks.rb
@@ -1,9 +1,22 @@
 
+#This is for the Headings test
 Before('@edit_user_page') do
-  if !$set_up_edited_page or !(ENV['REUSE_BROWSER'] == 'true')
+  if !$edit_user_page or !(ENV['REUSE_BROWSER'] == 'true')
     step 'I am logged in'
     step 'I am at my user page'
     step 'I edit the page with a string'
-    $set_up_edited_page=true
+    $edit_user_page=true
+  end
+end
+
+#This is for the bullets test and the indent-outdent test
+Before('@make_selectable_line') do
+  if !$make_selectable_line or !(ENV['REUSE_BROWSER'] == 'true')
+    step 'I am logged in'
+    step 'I am at my user page'
+    step 'I click Edit for VisualEditor'
+    step 'I type in an input string'
+    step 'select the string'
+    $make_selectable_line=true
   end
 end
\ No newline at end of file
diff --git a/modules/ve-mw/test/browser/features/visual_editor_bullets.feature 
b/modules/ve-mw/test/browser/features/visual_editor_bullets.feature
index 11dfa86..5074902 100644
--- a/modules/ve-mw/test/browser/features/visual_editor_bullets.feature
+++ b/modules/ve-mw/test/browser/features/visual_editor_bullets.feature
@@ -1,49 +1,38 @@
 @ie6-bug  @ie7-bug  @ie8-bug  @ie9-bug @ie10-bug @test2.wikipedia.org @login
-Feature: VisualEditor Bullets, Numbering, Indent, Outdent
-
-  Background:
-    Given I am logged in
-      And I am at my user page
-      And I click Edit for VisualEditor
-      And I type in an input string
-      And select the string
-
-  Scenario: Test Numbering
-    When I click Numbering
+Feature: VisualEditor Bullets, Numbering
+@make_selectable_line
+  Scenario Outline: check strings for bullets and numbering
+    When I click <control>
       And I click Save page
       And I click Review your changes
-    Then a # is added in front of input string in the diff view
+    Then a <character> is added in front of input string in the diff view
+      And I can click the up arrow on the save box
+  Examples:
+    | control   | character |
+    | Numbering | #         |
+    | Bullets   | *         |
 
-  Scenario: Test Bullets
-     When I click Bullets
-       And I click Save page
-       And I click Review your changes
-     Then a * is added in front of input string in the diff view
-
-  Scenario: Indents for Numbering
-    When I click Numbering
+  Scenario Outline: check increase indent for bullets and numbering
+    When I click <control>
       And I click Increase indentation
       And I click Save page
       And I click Review your changes
-    Then a ## is added in front of input string in the diff view
+    Then a <character> is added in front of input string in the diff view
+      And I can click the up arrow on the save box
+      And I click Decrease indentation
+  Examples:
+    | control   | character |
+    | Numbering | ##        |
+    | Bullets   | **        |
 
-  Scenario: Indents for Bullets
-    When I click Bullets
-      And I click Increase indentation
-      And I click Save page
-      And I click Review your changes
-    Then a ** is added in front of input string in the diff view
-
-  Scenario: Outdents for Numbering
-    When I click Numbering
+  Scenario Outline: check decrease indent for bullets and numbering
+    When I click <control>
       And I click Decrease indentation
       And I click Save page
       And I click Review your changes
     Then nothing is added in front of input string in the diff view
-
-  Scenario: Outdents for Bullets
-    When I click Bullets
-      And I click Decrease indentation
-      And I click Save page
-      And I click Review your changes
-    Then nothing is added in front of input string in the diff view
+      And I can click the up arrow on the save box
+  Examples:
+    | control   |
+    | Numbering |
+    | Bullets   |
diff --git 
a/modules/ve-mw/test/browser/features/visual_editor_indent_outdent.feature 
b/modules/ve-mw/test/browser/features/visual_editor_indent_outdent.feature
index 254b5c1..a9def47 100644
--- a/modules/ve-mw/test/browser/features/visual_editor_indent_outdent.feature
+++ b/modules/ve-mw/test/browser/features/visual_editor_indent_outdent.feature
@@ -1,35 +1,19 @@
 @ie6-bug  @ie7-bug  @ie8-bug  @ie9-bug @ie10-bug @test2.wikipedia.org @login
-Feature: VisualEditor Bullets, Numbering, Indent, Outdent
+Feature: VisualEditor Indent, Outdent
 
-  Background:
-    Given I am logged in
-      And I am at my user page
-      And I click Edit for VisualEditor
-      And I type in an input string
-      And select the string
-
-  Scenario: Check indentation controls disabled by default
+@make_selectable_line
+ Scenario: Check indentation controls disabled by default
     Then Decrease indentation should be disabled
       And Increase indentation should be disabled
 
-  Scenario: Check indentation controls enabled upon creating Bullet
-    When I click Bullets
-    Then Decrease indentation should be enabled
-       And Increase indentation should be enabled
-
-  Scenario: Check indentation controls enabled upon creating Numbering
-    When I click Numbering
-    Then Decrease indentation should be enabled
-       And Increase indentation should be enabled
-
-  Scenario: Check indentation controls disabled upon undoing Bullet
-    When I click Bullets
-      And  I undo Bullets
-    Then Decrease indentation should be disabled
-       And Increase indentation should be disabled
-
-  Scenario: Check indentation controls enabled upon creating Numbering
-    When I click Numbering
-      And I undo Numbering
-    Then Decrease indentation should be disabled
-       And Increase indentation should be disabled
\ No newline at end of file
+  Scenario Outline: check indent and outdent enable and disable
+    When I click <control>
+    Then Decrease indentation should be <initial_state>
+      And Increase indentation should be <initial_state>
+      And I undo <control>
+      And Decrease indentation should be <final_state>
+      And Increase indentation should be <final_state>
+  Examples:
+    | control   | initial_state | final_state |
+    | Bullets   | enabled       | disabled    |
+    | Numbering | enabled       | disabled    |
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I65970c0df35bcac48f16899090cadc8df8c560c6
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
Gerrit-Reviewer: Manybubbles <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: Zfilipin <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to