2010-07-16 14:41:04 +02:00
|
|
|
module TracksStepHelper
|
|
|
|
|
def submit_multiple_next_action_form
|
|
|
|
|
selenium.click("xpath=//form[@id='todo-form-multi-new-action']//button[@id='todo_multi_new_action_submit']", :wait_for => :ajax, :javascript_framework => :jquery)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def submit_next_action_form
|
|
|
|
|
selenium.click("xpath=//form[@id='todo-form-new-action']//button[@id='todo_new_action_submit']", :wait_for => :ajax, :javascript_framework => :jquery)
|
|
|
|
|
end
|
|
|
|
|
|
2010-07-29 18:06:30 +02:00
|
|
|
def submit_new_context_form
|
|
|
|
|
selenium.click("xpath=//form[@id='context-form']//button[@id='context_new_submit']", :wait_for => :ajax, :javascript_framework => :jquery)
|
|
|
|
|
end
|
|
|
|
|
|
2010-10-16 16:45:08 +02:00
|
|
|
def submit_new_project_form
|
|
|
|
|
selenium.click("xpath=//form[@id='project_form']//button[@id='project_new_project_submit']", :wait_for => :ajax, :javascript_framework => :jquery)
|
|
|
|
|
end
|
2011-01-08 09:12:37 +01:00
|
|
|
|
|
|
|
|
def format_date(date)
|
|
|
|
|
# copy-and-past from ApplicationController::format_date
|
|
|
|
|
return date ? date.in_time_zone(@current_user.prefs.time_zone).strftime("#{@current_user.prefs.date_format}") : ''
|
|
|
|
|
end
|
|
|
|
|
|
2011-01-08 19:50:19 +01:00
|
|
|
def execute_javascript(js)
|
|
|
|
|
selenium.get_eval "(function() {with(this) {#{js}}}).call(selenium.browserbot.getCurrentWindow());"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def clear_context_name_from_next_action_form
|
|
|
|
|
execute_javascript("$('#todo_context_name').val('');")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def clear_project_name_from_next_action_form
|
|
|
|
|
execute_javascript("$('#todo_project_name').val('');")
|
|
|
|
|
end
|
2011-01-08 09:12:37 +01:00
|
|
|
|
2010-07-16 14:41:04 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
World(TracksStepHelper)
|