epage $wanttxt
}
-fillformfield alice
-fillformfield bogus
-send "\t"
-submitform-expect "wrong password"
+proc loginas {user {password sesame} {wanttxt ACCESSGRANTED}} {
+ fillformfield $user
+ fillformfield $password
+ send "\t"
+ submitform-expect $wanttxt
+}
+
+loginas alice bogus "wrong password"
-fillformfield alice
-fillformfield sesame
-send "\t"
-submitform-expect "ACCESSGRANTED"
+loginas alice
etxt {path = '/Tsuffix'}
send "B\x10/Make sponges\r"
submitform-expect "You need to log in"
-fillformfield bob
-fillformfield sesame
-send "\t"
-submitform-expect "ACCESSGRANTED"
+loginas bob
send "/Logout\r"
submitform-expect "You have been logged out"
send "/Log in again\r"
submitform-expect "need to log in"
-fillformfield bob
-fillformfield sesame
-send "\t"
-submitform-expect "ACCESSGRANTED"
+
+loginas bob
send "BBB\x10/Make sponges\r"
submitform-expect "Login session interrupted"