Zfilipin has submitted this change and it was merged.

Change subject: scenario visual editor appears if user is logged in
......................................................................


scenario visual editor appears if user is logged in

Change-Id: I9425a17713dfbc5aaf66a29961ff91ff95081680
---
M features/step_definitions/visual_editor_steps.rb
M features/support/pages/visual_editor_page.rb
M features/visual_editor.feature
3 files changed, 29 insertions(+), 2 deletions(-)

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



diff --git a/features/step_definitions/visual_editor_steps.rb 
b/features/step_definitions/visual_editor_steps.rb
index d0cfc57..34f08a9 100644
--- a/features/step_definitions/visual_editor_steps.rb
+++ b/features/step_definitions/visual_editor_steps.rb
@@ -1,6 +1,7 @@
 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
@@ -11,39 +12,47 @@
     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!
     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.when_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
@@ -52,10 +61,20 @@
   @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
 
 Then(/^textbox with source text appears$/) do
- on(EditPage).article_text_element.should exist
+  on(EditPage).article_text_element.should exist
+end
+
+Then(/^Visual Editor page should open$/) do
+  @browser.url.should match /\?veaction=edit/
+  @browser.url.should_not match /&action=edit/
+end
+
+Then(/^Visual Editor toolbar should appear$/) do
+  on(VisualEditorPage).visual_editor_toolbar_element.when_present.should 
be_visible
 end
diff --git a/features/support/pages/visual_editor_page.rb 
b/features/support/pages/visual_editor_page.rb
index 62e1ce1..f850214 100644
--- a/features/support/pages/visual_editor_page.rb
+++ b/features/support/pages/visual_editor_page.rb
@@ -21,6 +21,7 @@
   span(:second_save_page, class: 've-ui-labeledElement-label', text: 'Save 
page', index: 1)
   span(:ve_link_icon, class: 've-ui-buttonTool-icon ve-ui-icon-link')
   span(:ve_references, class: 've-ui-buttonTool-icon ve-ui-icon-reference')
+  div(:visual_editor_toolbar, class: 've-ui-toolbar-tools')
   span(:transclusion, class: 've-ui-buttonTool-icon ve-ui-icon-template')
 
   in_frame(:index => 0) do |frame|
diff --git a/features/visual_editor.feature b/features/visual_editor.feature
index c31208f..0d2a31f 100644
--- a/features/visual_editor.feature
+++ b/features/visual_editor.feature
@@ -7,7 +7,14 @@
       And I click the Edit link on the wiki page
     Then Edit Source page should open
       And textbox with source text appears
-   
+
+  Scenario: Visual editor appears if user is logged in
+     Given I am logged in
+     When I am at random page
+       And I click the Edit link on the wiki page
+     Then Visual Editor page should open
+       And Visual Editor toolbar should appear
+
   @login
   Scenario: Basic edit
     Given I am logged in

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9425a17713dfbc5aaf66a29961ff91ff95081680
Gerrit-PatchSet: 4
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Rachel99 <rachelq...@gmail.com>
Gerrit-Reviewer: Cmcmahon <cmcma...@wikimedia.org>
Gerrit-Reviewer: Zfilipin <zfili...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to