# Source procedures
source tcl/test-procs.tcl

# Test Execution START

# Request the root page
::twt::do_request $server_url

# Check that database connection is there and configuration is ok
assert ![regexp -nocase "At least one misconfiguration was discovered" "[response text]"]

# Fill in administrator info
field find ~f ~n email
field fill "$admin_email"
field find ~f ~n "first_names"
field fill "$admin_first_names"
field find ~f ~n last_name
field fill "$admin_last_name"
field find ~n password
field fill "$admin_password"
field find ~n password_confirmation
field fill "$admin_password"

# Fill in the system settings
field find ~n system_url
field fill "$server_url"
field find ~n system_name
field fill "$system_name"
field find ~n publisher_name
field fill "$publisher_name"
field find ~n system_owner
field fill "$system_owner_email"
field find ~n admin_owner
field fill "$admin_owner_email"
field find ~n host_administrator
field fill "$admin_owner_email"
field find ~n outgoing_sender
field fill "$outgoing_sender_email"
field find ~n new_registrations
field fill "$new_registrations_email"

form submit

::twt::write_response_to_file $install_output_file

# Test Execution END
