|
From: <jgr...@us...> - 2003-08-23 22:22:49
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1:/tmp/cvs-serv29229/tests Modified Files: TestHTML.script TestHTML.tst Log Message: Adding tests for the History page: currently cover basic display of messages, searching, filtering, page navigration, click through to bucket information, refresh NEWFL message Index: TestHTML.script =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestHTML.script,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TestHTML.script 23 Aug 2003 00:48:24 -0000 1.12 --- TestHTML.script 23 Aug 2003 22:22:46 -0000 1.13 *************** *** 43,46 **** --- 43,47 ---- # PARAMETERIS a b c Check that parameter b in bucket a has value c # CLICK a Click the button called a + # SENDMSG a b Send a message through the POPFile MQ (message a with parameter b) # # Expect that the following are available to you within the MATCH/ENDMATCH block *************** *** 131,147 **** ENDMATCH ! # TODO History Page - # TODO Check for existence of messages - # TODO Check the page navigator - # TODO Check refresh - # TODO Check search - # TODO Check filter # TODO Check reclassification # TODO Check delete some messages # TODO Check delete page of messages # TODO Check delete all messages ! # TODO Check sorting ! # TODO Check click through from bucket name # TODO single message view for accuracy --- 132,261 ---- ENDMATCH ! # History Page ! ! GET /history ! ! # Check for existence of messages, check that there ! # are links from the bucket names, check that the basic ! # sort options are present ! ! MATCH <no subject line> ! MATCH <a title=" test\@test.com"> test\@test.com</a> ! MATCH Enlarge your package Doctor ApprovedNH... ! MATCH <no from line> ! MATCH Douglas Arnold <0noy8\@worldnet.att.net>... ! MATCH VI ID: 24052 Status: Open Sev: 2 ! MATCH <a href="buckets?session=$sk&showbucket=spam"><font color="blue">spam</font></a> ! MATCH >ID ! MATCH <a href="/history?session=$sk&setsort=from">From</a> ! ! # Check the page navigator ! ! MATCH Jump to message: <b>1</b> [<a href="/history?start_message=20&session=$sk">21</a>] [<a href="/history?start_message=20&session=$sk">Next ></a>] ! NOTMATCH XoSeXyGoDdEsSm\@hotmail.com ! GET /history?start_message=20&session=$sk ! MATCH Jump to message: [<a href="/history?start_message=0&session=$sk">< Previous</a>] [<a href="/history?start_message=0&session=$sk">1</a>] <b>21</b> ! MATCH XoSeXyGoDdEsSm\@hotmail.com ! MATCH from: Leandro ! NOTMATCH Douglas Arnold <0noy8\@worldnet.att.net>... ! GET /history ! ! # Check refresh ! ! NOTMATCH Testing Refresh ! MATCH (<a class="history" href="/history?session=$sk&setfilter=">Refresh</a>) ! CODE ! open NEWMSG, ">messages/popfile10000=1.msg"; ! print NEWMSG <<EOM; ! From: John ! Subject: Testing Refresh ! ! Body would go here ! EOM ! close NEWMSG; ! open NEWCLS, ">messages/popfile10000=1.cls"; ! print NEWCLS "personal\n"; ! close NEWCLS; ! ENDCODE ! SENDMSG NEWFL popfile10000=1.msg ! GET /history?session=$sk&setfilter= ! MATCH John ! MATCH Testing Refresh ! MATCH personal ! MATCH popfile10000=1 ! ! # Check search ! ! SETSUBMIT search isnotpresent ! MATCH searched for from/subject isnotpresent ! MATCH No messages. ! NOTMATCH Jump to message ! CLICK reset_filter_search ! NOTMATCH searched for from/subject ! NOTMATCH No messages. ! MATCH Douglas Arnold <0noy8\@worldnet.att.net>... ! MATCH Jump to message ! ! SETSUBMIT search test.com ! MATCH searched for from/subject test.com ! MATCH test\@test.com ! NOTMATCH Enlarge your package Doctor ApprovedNH... ! NOTMATCH Jump to message ! CLICK reset_filter_search ! NOTMATCH searched for from/subject ! NOTMATCH No messages. ! MATCH Douglas Arnold <0noy8\@worldnet.att.net>... ! MATCH Jump to message ! ! SETSUBMIT search Doctor ! MATCH searched for from/subject Doctor ! NOTMATCH test\@test.com ! MATCH Enlarge your package Doctor ApprovedNH... ! NOTMATCH Jump to message ! CLICK reset_filter_search ! NOTMATCH searched for from/subject ! NOTMATCH No messages. ! MATCH Douglas Arnold <0noy8\@worldnet.att.net>... ! MATCH Jump to message ! ! # Check filter ! ! SETINPUT filter personal ! CLICK setfilter ! MATCH (just showing bucket <font color="green">personal</font>) ! NOTMATCH Douglas Arnold <0noy8\@worldnet.att.net>... ! MATCH Testing Refresh ! CLICK reset_filter_search ! SETINPUT filter spam ! CLICK setfilter ! MATCH (just showing bucket <font color="blue">spam</font>) ! MATCH Douglas Arnold <0noy8\@worldnet.att.net>... ! NOTMATCH Testing Refresh ! MATCH Jump to message: <b>1</b> [<a href="/history?start_message=20&session=$sk&filter=spam">21</a>] [<a href="/history?start_message=20&session=$sk&filter=spam">Next ></a>] ! GET /history?start_message=20&session=$sk&filter=spam ! NOTMATCH Testing Refresh ! SETINPUT filter other ! CLICK setfilter ! MATCH (just showing bucket <font color="red">other</font>) ! MATCH No messages. ! CLICK reset_filter_search ! ! # TODO Check sorting ! ! # TODO Check reclassification + + # TODO Check delete one message # TODO Check delete some messages # TODO Check delete page of messages # TODO Check delete all messages ! ! # Check click through from bucket name ! ! MATCH <a href="buckets?session=$sk&showbucket=spam"><font color="blue">spam</font></a> ! GET /buckets?session=$sk&showbucket=spam ! MATCH Detail for <font color="blue">spam</font> ! GET /history # TODO single message view for accuracy Index: TestHTML.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestHTML.tst,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TestHTML.tst 23 Aug 2003 00:48:24 -0000 1.16 --- TestHTML.tst 23 Aug 2003 22:22:46 -0000 1.17 *************** *** 232,235 **** --- 232,242 ---- } + if ( $command =~ /^__SENDMESSAGE ([^ ]+) (.+)/ ) { + $b->mq_post_( $1, $2, '' ); + $mq->service(); + print $uwriter "OK\n"; + next; + } + if ( $command =~ /^__CHECKMAGNET ([^ ]+) ([^ ]+) ([^\r\n]+)/ ) { my $found = 0; *************** *** 325,328 **** --- 332,346 ---- } + if ( $line =~ /^SENDMSG +([^ ]+) (.+)$/ ) { + my ( $msg, $param ) = ( $1, $2 ); + print $dwriter "__SENDMESSAGE $msg $param\n"; + my $reply = <$ureader>; + + if ( !( $reply =~ /^OK/ ) ) { + test_assert( 0, "From script line $line_number" ); + } + next; + } + if ( $line =~ /^MAGNETIS +([^ ]+) ([^ ]+) (.+)$/ ) { my ( $bucket, $type, $magnet ) = ( $1, $2, $3 ); *************** *** 406,411 **** } - $block .= "\n" unless ( $block eq '' ); $block .= $line; } --- 424,429 ---- } $block .= $line; + $block .= "\n"; } |