QA: updates to edit test ported from qa/browsertests
authorCmcmahon <cmcmahon@wikimedia.org>
Tue, 1 Jul 2014 19:26:57 +0000 (12:26 -0700)
committerCmcmahon <cmcmahon@wikimedia.org>
Tue, 1 Jul 2014 19:27:32 +0000 (12:27 -0700)
Change-Id: I2ceae6ee6f98df78c12d257fd6503f5bf6395284

tests/browser/features/edit_page.feature
tests/browser/features/step_definitions/edit_page_steps.rb
tests/browser/features/support/pages/edit_page.rb

index ef9991a..1b428d7 100644 (file)
@@ -5,5 +5,7 @@ Feature: Edit Page
     Given I go to the "Editing Test Page" page with content "This is a page to test editing"
     When I click Edit
       And I edit the page with "Edited and a random string"
+      And I click Preview
+      And I click Show Changes
       And I save the edit
-    Then the edited page content should contain "Edited and a random string"
+    Then the edited page content should contain "Edited and a random string"
\ No newline at end of file
index 5af097b..5ab02be 100644 (file)
@@ -2,6 +2,14 @@ When(/^I click Edit$/) do
   on(MainPage).edit_link
 end
 
+When(/^I click Preview$/) do
+  on(EditPage).preview_button
+end
+
+When(/^I click Show Changes$/) do
+  on(EditPage).show_changes_button
+end
+
 When(/^I edit the page with "(.*?)"$/) do |edit_content|
   on(EditPage).edit_page_content_element.send_keys(edit_content + @random_string)
 end
index 594ac73..b619c34 100644 (file)
@@ -2,6 +2,7 @@ class EditPage
   include PageObject
 
   text_area(:edit_page_content, id: "wpTextbox1")
+  button(:preview_button, id: "wpPreview")
+  button(:show_changes_button, id: "wpDiff")
   button(:save_button, id: "wpSave")
-
 end
\ No newline at end of file