|
From: <jgr...@us...> - 2003-08-24 01:20:37
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1:/tmp/cvs-serv18961/tests Modified Files: TestHTML.script TestHTML.tst Log Message: Added HTML interface tests for most of the History functions including the Single Message View, also covers Password and Shutdown handling and miscellaneous items like use of a bad session key, 404 errors; coverage is now at 88% for HTML.pm. Need to finish reclassification and deletion tests Index: TestHTML.script =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestHTML.script,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TestHTML.script 23 Aug 2003 22:22:46 -0000 1.13 --- TestHTML.script 24 Aug 2003 01:20:34 -0000 1.14 *************** *** 40,43 **** --- 40,44 ---- # SETSUBMIT a b Just like doing SETINPUT a b followed by SUBMIT a # CONFIGIS a b Verify that config item a has value b + # SETCONFIG a b Set config item a to b # MAGNETIS a b c Checks that magnet c exists in bucket a with type b # PARAMETERIS a b c Check that parameter b in bucket a has value c *************** *** 121,125 **** GET /security ! MATCH <td class="menuSelected" align="center"> <a class="menuLink" href="/security?session=$sk"> --- 122,126 ---- GET /security ! MATCH <td class="menuSelected" align="center"> <a class="menuLink" href="/security?session=$sk"> *************** *** 141,148 **** 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> --- 142,149 ---- MATCH <no subject line> ! MATCH <a title="test\@test.com">test\@test.com</a> ! MATCH Enlarge your package Doctor ApprovedNHOB... 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> *************** *** 158,162 **** MATCH XoSeXyGoDdEsSm\@hotmail.com MATCH from: Leandro ! NOTMATCH Douglas Arnold <0noy8\@worldnet.att.net>... GET /history --- 159,163 ---- MATCH XoSeXyGoDdEsSm\@hotmail.com MATCH from: Leandro ! NOTMATCH Douglas Arnold <0noy8\@worldnet.att.net> GET /history *************** *** 194,198 **** NOTMATCH searched for from/subject NOTMATCH No messages. ! MATCH Douglas Arnold <0noy8\@worldnet.att.net>... MATCH Jump to message --- 195,199 ---- NOTMATCH searched for from/subject NOTMATCH No messages. ! MATCH Douglas Arnold <0noy8\@worldnet.att.net> MATCH Jump to message *************** *** 200,209 **** 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 --- 201,210 ---- MATCH searched for from/subject test.com MATCH test\@test.com ! NOTMATCH Enlarge your package Doctor ApprovedNHOB... 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 *************** *** 211,220 **** 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 --- 212,221 ---- MATCH searched for from/subject Doctor NOTMATCH test\@test.com ! MATCH Enlarge your package Doctor ApprovedNHOB... 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 *************** *** 224,228 **** 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 --- 225,229 ---- 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 *************** *** 230,234 **** 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>] --- 231,235 ---- 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>] *************** *** 241,255 **** 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 --- 242,258 ---- CLICK reset_filter_search ! # Check sorting + MATCH <a href="/history?session=$sk&setsort=bucket">Classification</a> + GET /history?session=$sk&setsort=bucket + MATCH <a href="buckets?session=$sk&showbucket=personal"><font color="green">personal</font></a> + MATCH <a href="/history?session=$sk&setsort=-bucket"><em class="historyLabelSort">>Classification</em></a> + GET /history?session=$sk&setsort=-bucket + MATCH <a href="/history?session=$sk&setsort=bucket"><em class="historyLabelSort"><Classification</em></a> + NOTMATCH <a href="buckets?session=$sk&showbucket=personal"><font color="green">personal</font></a> + GET /history?session=$sk&setsort= # TODO Check reclassification # Check click through from bucket name *************** *** 259,265 **** GET /history ! # TODO single message view for accuracy # TODO reclassify from single message view # Magnets Page --- 262,331 ---- GET /history ! # Single message view for accuracy ! ! MATCH <a class="messageLink" title="Testing Refresh" href="/view?view=popfile10000=1.msg&start_message=0&session=$sk">Testing Refresh</a> ! GET /view?view=popfile10000=1.msg&start_message=0&session=$sk ! MATCH Single Message View ! MATCH Testing Refresh ! MATCH John ! MATCH <font color=\"green\">personal</font> ! MATCH Scores ! MATCH 0.769209 ! MATCH 0.230763 ! MATCH 2.829186e-05 ! MATCH <font color="red">here</font> ! MATCH 0.0017 ! MATCH 0.0034 ! MATCH <font color="black">John</font> ! MATCH <font color="red">here</font> ! MATCH Body would ! ! # Jump to message ! ! GET /jump_to_message?view=popfile10000=1.msg ! MATCH Single Message View ! MATCH Testing Refresh ! MATCH John ! MATCH <font color=\"green\">personal</font> ! MATCH Scores ! MATCH 0.769209 ! MATCH 0.230763 ! MATCH 2.829186e-05 ! MATCH <font color="red">here</font> ! MATCH 0.0017 ! MATCH 0.0034 ! MATCH <font color="black">John</font> ! MATCH <font color="red">here</font> ! MATCH Body would ! ! GET /jump_to_message?view=popfile10001=1.msg ! NOTMATCH Single Message View ! MATCH Recent Messages ! ! # TODO quick magnets # TODO reclassify from single message view + # TODO Check delete one message + + MATCH Testing Refresh + GET /history + #SETINPUT remove on + #CLICK deletemessage + #NOTMATCH Testing Refresh + + # TODO Check delete some messages + + # Check delete page of messages + + GET /history + CLICK clearpage + MATCH <a href="buckets?session=$sk&showbucket=spam"><font color="blue">spam</font></a> + NOTMATCH 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>] + + # Check delete all messages + + CLICK clearall + MATCH No messages. + # Magnets Page *************** *** 291,294 **** --- 357,370 ---- MAGNETIS spam subject newmagnet + SETINPUT text0 foo + SETINPUT type0 from + SETSUBMIT bucket0 personal + MATCH Magnet 'from: foo' already exists in bucket 'personal' + + SETINPUT text0 fo + SETINPUT type0 from + SETSUBMIT bucket0 personal + MATCH New magnet 'from: fo' clashes with magnet 'from: foo' in bucket 'personal' and could cause ambiguous results. + # Check magnet change value *************** *** 351,356 **** --- 427,444 ---- INPUTIS type4 to + # Check the magnet navigator + + GET /configuration + SETSUBMIT page_size 3 + GET /magnets + MATCH Jump to magnet page: <b>1</b> [<a href="/magnets?start_magnet=3&session=$sk">2</a>] [<a href="/magnets?start_magnet=3&session=$sk">Next ></a>] + GET /magnets?start_magnet=3&session=$sk + MATCH Jump to magnet page: [<a href="/magnets?start_magnet=0&session=$sk">< Previous</a>] [<a href="/magnets?start_magnet=0&session=$sk">1</a>] <b>2</b> + GET /configuration + SETSUBMIT page_size 20 + # Check magnet deletion + GET /magnets SETINPUT remove5 on CLICK delete *************** *** 667,673 **** # Check statistics displayed correctly - MATCH >Not enough data< - MATCH >0 ( 0.00%)< - MATCH >1,785 (12.74%)< MATCH >103 (0.73%)< --- 755,758 ---- *************** *** 678,682 **** MATCH <td bgcolor="blue" title="spam (86.51%)" width="86%"><img src="pix.gif" alt="" height="20" width="1" /></td> ! # TODO Check Reset Statistics # Check bucket creation --- 763,774 ---- MATCH <td bgcolor="blue" title="spam (86.51%)" width="86%"><img src="pix.gif" alt="" height="20" width="1" /></td> ! # Check Reset Statistics ! ! MATCH <td align="right">132</td> ! MATCH <td align="right">3</td> ! MATCH <td align="right">97.72%</td> ! CLICK reset_stats ! MATCH >Not enough data< ! MATCH >0 ( 0.00%)< # Check bucket creation *************** *** 693,696 **** --- 785,791 ---- MATCH Bucket names can only contain the letters a to z in lower case + SETSUBMIT cname spam + MATCH Bucket named spam already exists + MATCH spam MATCH personal *************** *** 785,788 **** MATCH <td width="1%"> </td><td align="right">0</td><td width="1%"> </td> ! # TODO Check shutdown operation ! # TODO Check bad session key \ No newline at end of file --- 880,926 ---- MATCH <td width="1%"> </td><td align="right">0</td><td width="1%"> </td> ! # Check the login message ! ! SENDMSG LOGIN iloggedin ! GET / ! MATCH - iloggedin) ! ! # Check bad session key ! ! GET /history?session=123456 ! MATCH POPFile Session Expired ! ! # TODO Get ICO, GIF, CSS, PNG, LOG and HTML file ! ! # Get a page that does not exist ! ! GET /foo ! ! # Check update checking ! ! SETCONFIG html_update_check 1 ! SETCONFIG html_send_stats 1 ! SETCONFIG html_last_update_check 0 ! SETCONFIG GLOBAL_ecount 1 ! GET / ! MATCH popfile_update.pl ! MATCH popfile_stats.pl ! ! # Check the operation of passwords ! ! GET /security ! INPUTIS password ! CONFIGIS html_password ! SETSUBMIT password secret ! GET /advanced?session=123456 ! MATCH Enter password: ! SETSUBMIT password secret ! MATCH All POPFile Parameters ! GET /security ! ! # Check shutdown operation ! ! GET /shutdown ! MATCH Enter password: ! SETSUBMIT password secret ! MATCH POPFile shutdown Index: TestHTML.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestHTML.tst,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TestHTML.tst 23 Aug 2003 22:22:46 -0000 1.17 --- TestHTML.tst 24 Aug 2003 01:20:34 -0000 1.18 *************** *** 169,173 **** $p->logger( $l ); $p->classifier( $b ); ! $p->version( 'testsuite' ); $p->initialize(); --- 169,173 ---- $p->logger( $l ); $p->classifier( $b ); ! $p->version( 'vtest.suite.ver' ); $p->initialize(); *************** *** 179,183 **** $h->classifier( $b ); $h->initialize(); ! $h->version( 'testsuite' ); test_assert_equal( $h->language(), 'English' ); our $version = $h->version(); --- 179,183 ---- $h->classifier( $b ); $h->initialize(); ! $h->version( 'vtest.suite.ver' ); test_assert_equal( $h->language(), 'English' ); our $version = $h->version(); *************** *** 210,214 **** while ( 1 ) { ! last if !$h->service(); if ( pipeready( $dreader ) ) { --- 210,214 ---- while ( 1 ) { ! $h->service(); if ( pipeready( $dreader ) ) { *************** *** 216,219 **** --- 216,220 ---- if ( $command =~ /^__QUIT/ ) { + $h->stop(); print $uwriter "OK\n"; last; *************** *** 226,229 **** --- 227,236 ---- } + if ( $command =~ /^__SETCONFIG (.+) (.+)/ ) { + $c->parameter( $1, $2 ); + print $uwriter "OK\n"; + next; + } + if ( $command =~ /^__GETPARAMETER ([^ ]+) (.+)/ ) { my $value = $b->get_bucket_parameter( $1, $2 ); *************** *** 329,332 **** --- 336,351 ---- $reply =~ /^OK ([^\r\n]+)/; test_assert_equal( $1, $expected, "From script line $line_number" ); + next; + } + + if ( $line =~ /^SETCONFIG +([^ ]+) ?(.+)?$/ ) { + my ( $option, $value ) = ( $1, $2 ); + $value = '' if ( !defined( $value ) ); + print $dwriter "__SETCONFIG $option $value\n"; + my $reply = <$ureader>; + + if ( !( $reply =~ /^OK/ ) ) { + test_assert( 0, "From script line $line_number" ); + } next; } |