Index: openacs-4/contrib/packages/simulation/test/simulation-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/test/Attic/simulation-test-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/contrib/packages/simulation/test/simulation-test-procs.tcl 6 Jan 2004 17:24:18 -0000 1.4 +++ openacs-4/contrib/packages/simulation/test/simulation-test-procs.tcl 7 Jan 2004 10:39:31 -0000 1.5 @@ -51,6 +51,7 @@ set_object_form_type $type + form find ~n object field find ~n title field fill $title form submit @@ -69,15 +70,16 @@ do_request /acs-admin/users/user-add field find ~n email set email_account [string map {" " _} "$first_names $last_name"] - field fill "${email_account}@test.test" + set email "${email_account}@test.test" + field fill $email field find ~n first_names field fill $first_names field find ~n last_name field fill $last_name field find ~n password - field fill "1" + field fill [::twt::user::get_password $email] field find ~n password_confirm - field fill "1" + field fill [::twt::user::get_password $email] form submit } @@ -118,7 +120,7 @@ object_type acs_object package_key simulation pretty_name { - Simulatie Tilburg + Simulation Tilburg } roles { lawyer { @@ -244,3 +246,57 @@ } }" } + +ad_proc ::twt::simulation::add_template { + {-template_name:required} +} { + do_request /simulation/simbuild/template-edit + form find ~n sim_template + field fill $template_name ~n name + form submit +} + +ad_proc ::twt::simulation::add_roles_to_template { + {-template_name:required} + {-character_array:required} +} { + upvar $character_array characters + + ::twt::simulation::visit_template_page $template_name + link follow ~u role-edit + set add_role_url [response url] + foreach character_name [array names characters] { + do_request $add_role_url + form find ~n role + field find ~n name + field fill $characters($character_name) + form submit + } +} + +ad_proc ::twt::simulation::add_tasks_to_template { + {-template_name:required} + {-task_array:required} +} { + upvar $task_array tasks + + ::twt::simulation::visit_template_page $template_name + + link follow ~u task-edit + set add_task_url [response url] + + foreach task_name [array names tasks] { + array set task $tasks($task_name) + do_request $add_task_url + form find ~n task + field find ~n name + field fill $task_name + field find ~n assigned_role + field select $task(assigned_role) + field find ~n recipient_role + field select $task(recipient_role) + field find ~n description + field fill "This is the task description for task $task_name" + form submit + } +} \ No newline at end of file