Zfilipin has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/73967


Change subject: Scenario: Visual editor does not appear if user is not logged in
......................................................................

Scenario: Visual editor does not appear if user is not logged in

Feature: VisualEditor

I have paired on this with Rachel. For now we just check page URL to
see if Visual Editor opens or not.

Change-Id: I6216eb7c155b2ed4a31052691fa40f1dfa1533ec
TODO: check page content to see if Visual editor opened or not.
---
M features/step_definitions/visual_editor_steps.rb
M features/visual_editor.feature
2 files changed, 16 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests 
refs/changes/67/73967/1

diff --git a/features/step_definitions/visual_editor_steps.rb 
b/features/step_definitions/visual_editor_steps.rb
index 541c40b..68378c9 100644
--- a/features/step_definitions/visual_editor_steps.rb
+++ b/features/step_definitions/visual_editor_steps.rb
@@ -1,6 +1,9 @@
 Given(/^I am at my user page$/) do
   visit(VisualEditorPage)
 end
+Given(/^I am not logged in$/) do
+  # user is logged out by default, nothing to do here
+end
 
 When(/^I click Review and Save$/) do
   on(VisualEditorPage) do |page|
@@ -8,18 +11,15 @@
     page.review_and_save_element.when_visible.click
   end
 end
-
 When(/^I click Looks good to me$/) do
   on(VisualEditorPage) do |page|
     page.diff_view_element.when_visible.should be_visible
     page.looks_good_element.click
   end
 end
-
 When(/^I click This is a minor edit$/) do
   on(VisualEditorPage).minor_edit_element.when_present.click
 end
-
 When(/^I click Save page$/) do
   on(VisualEditorPage) do |page|
      sleep 2 # blame Chris for this!
@@ -27,33 +27,32 @@
     page.save_page_element.when_present.click
   end
 end
-
 When(/^I click Save page the second time$/) do
     on(VisualEditorPage).second_save_page_element.when_present.click
 end
-
 When(/^I edit the page with a string$/) do
   on(VisualEditorPage) do |page|
     page.edit_ve
     page.content_element.when_visible.send_keys("Editing with 
#{@does_not_exist_page_name}")
   end
 end
-
 When(/^I click Return to save form$/) do
   on(VisualEditorPage) do |page|
     page.diff_view_element.wait_until_present
     page.return_to_save_element.when_present.click
   end
 end
-
 When(/^I click Review your changes$/) do
   on(VisualEditorPage).review_changes_element.when_present.click
 end
-
 When(/^I edit the description of the change$/) do
   
on(VisualEditorPage).describe_change_element.when_visible.send_keys("Describing 
with #{@does_not_exist_page_name}")
 end
 
+Then(/^Edit Source page should open$/) do
+  @browser.url.should match /&action=edit/
+  @browser.url.should_not match /\?veaction=edit/
+end
 Then(/^Page text should contain the string$/) do
   on(VisualEditorPage).page_text_element.when_present.text.should match 
Regexp.escape("Editing with #{@does_not_exist_page_name}")
 end
diff --git a/features/visual_editor.feature b/features/visual_editor.feature
index 0994030..27f310e 100644
--- a/features/visual_editor.feature
+++ b/features/visual_editor.feature
@@ -1,11 +1,16 @@
-@ie6-bug  @ie7-bug  @ie8-bug @test2.wikipedia.org @login
+@ie6-bug  @ie7-bug  @ie8-bug @test2.wikipedia.org
 Feature: VisualEditor
 
-  Background:
-    Given I am logged in
+  Scenario: Visual editor does not appear if user is not logged in
+    Given I am not logged in
+    When I am at random page
+      And I click the Edit link on the wiki page
+    Then Edit Source page should open
 
+  @login
   Scenario: Basic edit
-    Given I am at my user page
+    Given I am logged in
+      And I am at my user page
     When I edit the page with a string
       And I click Save page
       And I click This is a minor edit

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6216eb7c155b2ed4a31052691fa40f1dfa1533ec
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Zfilipin <[email protected]>

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

Reply via email to