Skip to content
Browse files

simplified the "worklists exists" stepdef to just go to the url where…

… it should be able to find the list it's looking for, and added a stepdef for making sure the list is empty
  • Loading branch information...
1 parent 5c1d47a commit e4857db71c531c508fa534afbd2d221e458195c0 @jorahood committed Sep 16, 2011
Showing with 22 additions and 3 deletions.
  1. +17 −2 features/step_definitions/all_steps.rb
  2. +5 −1 features/support/paths.rb
View
19 features/step_definitions/all_steps.rb
@@ -32,16 +32,31 @@ def frame_id
}
end
-Given /^a (ditaval|map|topic|worklist) exists with id (\d+)$/ do |thing, id|
+Given /^I search for a (ditaval|map|topic|worklist) with id (\d+)$/ do |thing, id|
steps %Q{
Given I go to the homepage
And I follow "Document Search"
And I fill in "Document/Notification Id:" with "#{id}" in the frame
- And I press "search" in the frame
+ When I press "search" in the frame
Then I should see "1 items found." in the frame
}
end
+Given /^a worklist exists with id (\d+)$/ do |id|
+ steps %Q{
+ When I go to "/kms-snd/worklist.do?methodToCall=docHandler&docId=#{id}&command=displayDocSearchView#topOfForm"
+ Then I should see "#{id}" within "table.headerinfo"
+ And I should not see "Document no longer exists."
+ }
+end
+
+Given /^worklist (\d+) is empty$/ do |id|
+ steps %Q{
+ When I go to "/kms-snd/worklist.do?methodToCall=docHandler&docId=#{id}&command=displayDocSearchView#topOfForm"
+ Then I should not see "1:" within "table#workListItems"
+ }
+end
+
#with single quotes since we may need double quotes in the string
Given /^(?:|I )fill in "([^"]*)" with '([^']*)'$/ do |field, string|
fill_in(field, :with => string)
View
6 features/support/paths.rb
@@ -11,7 +11,11 @@ def webroot
def path_to(page_name)
case page_name
-
+
+ # stolen and stripped down from http://asciicasts.com/episodes/186-pickle-with-cucumber
+ when /"(\/.+)"/
+ $1
+
when /the homepage/
"#{webroot}"

0 comments on commit e4857db

Please sign in to comment.
Something went wrong with that request. Please try again.