Zfilipin has submitted this change and it was merged.

Change subject: Several refactorings, see comment
......................................................................


Several refactorings, see comment

Change-Id: Ibf03ca50589be23c18bfc68cc4b75d0b18f18421
---
M features/page.feature
M features/step_definitions/page_steps.rb
2 files changed, 16 insertions(+), 15 deletions(-)

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



diff --git a/features/page.feature b/features/page.feature
index 975f5f7..7cfe799 100644
--- a/features/page.feature
+++ b/features/page.feature
@@ -38,7 +38,7 @@
       And I am starting a page to be moved
       And I create the page to be moved
     When I click Move
-    Then I should be on a page that says Move newly created page
+    Then I should be on a page Move newly created page
       And I should see a Namespace selectbox
       And I should see a To new title textbox
       And I should see a Reason textarea
@@ -51,7 +51,7 @@
     And I have clicked Move on the newly created page
     When I make a new page name for the moved page
       And I click Move page
-    Then I should be on a page that says Move succeeded
+    Then I should be on a page that says has been moved
       And I should see the text A redirect has been created
       And I should have a link to the old page title and a link to the new 
page title
       And the the new page should have the correct text
diff --git a/features/step_definitions/page_steps.rb 
b/features/step_definitions/page_steps.rb
index 8667ae4..92cb91a 100644
--- a/features/step_definitions/page_steps.rb
+++ b/features/step_definitions/page_steps.rb
@@ -52,13 +52,15 @@
 end
 
 When(/^I click Move$/) do
-  on(ArticlePage).actions_link
-  on(ArticlePage).move_link
+  on(ArticlePage) do |page|
+    page.actions_link
+    page.move_link
+  end
 end
 
-Then(/^I should be on a page that says Move newly created page$/) do
+Then(/^I should be on a page Move newly created page$/) do
   @browser.url.should match Regexp.escape('Special:MovePage')
-  @browser.text.should match Regexp.escape("Move page: 
#{@does_not_exist_page_name}")
+  on(ArticlePage).page_text.should match Regexp.escape("Move page: 
#{@does_not_exist_page_name}")
 end
 
 Then(/^I should see a Namespace selectbox$/) do
@@ -100,17 +102,19 @@
   on(MovePage).move_page
 end
 
-Then(/^I should be on a page that says Move succeeded$/) do
-  @browser.text.should match Regexp.escape('Move succeeded')
+Then(/^I should be on a page that says (.+)$/) do |success_message|
+  on(ArticlePage).page_text.should match Regexp.escape(success_message)
 end
 
 Then(/^I should have a link to the old page title and a link to the new page 
title$/) do
-  
on(MovePage).old_page_link_element(@does_not_exist_page_name).when_present.should
 exist
-  
on(MovePage).moved_page_link_element(@does_not_exist_page_name).when_present.should
 exist
+  on(MovePage) do |page|
+    page.old_page_link_element(@does_not_exist_page_name).when_present.should 
exist
+    
page.moved_page_link_element(@does_not_exist_page_name).when_present.should 
exist
+  end
 end
 
 Then(/^I should see the text A redirect has been created$/) do
-  @browser.text.should match Regexp.escape('A redirect has been created')
+  on(ArticlePage).page_text.should match Regexp.escape('A redirect has been 
created')
 end
 
 Then(/^the the new page should have the correct text$/) do
@@ -126,7 +130,4 @@
     page.body_content.should match(/Moved/)
     page.body_content.should_not match(/Redirect page/)
   end
-end
-
-
-
+end
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf03ca50589be23c18bfc68cc4b75d0b18f18421
Gerrit-PatchSet: 4
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <cmcma...@wikimedia.org>
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