This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Simplifying postfix usage for select datetime

  • Loading branch information...
vinibaggio committed Mar 1, 2011
1 parent 32860fe commit 452fc62b5f446ffe0173d94b4b58f9b64586d703
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/hermes/actions.rb
View
@@ -3,11 +3,11 @@ module Hermes
module Actions
POSTFIXES = {
:year => 1,
:month => 2,
:day => 3,
:hour => 4,
:minute => 5
:year => '1i',
:month => '2i',
:day => '3i',
:hour => '4i',
:minute => '5i'
}.freeze
def select_datetime(datetime, options={})
@@ -47,11 +47,11 @@ def select_date(date, options={})
private
def find_and_select_option(select_prefix, order, value)
def find_and_select_option(select_prefix, postfix, value)
no_select_msg = "cannot select option, no select box with id prefix '#{select_prefix}' found"
no_option_msg = "cannot select option, no option with text '#{value}' in select box '#{select_prefix}'"
select = find(:css, "##{select_prefix}_#{order}i", :message => no_select_msg)
select = find(:css, "##{select_prefix}_#{postfix}", :message => no_select_msg)
select.find(:xpath, ".//option[contains(./@value, '#{value}')]", :message => no_option_msg).select_option
end

0 comments on commit 452fc62

Please sign in to comment.