Index: openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl,v diff -u -N -r1.69 -r1.70 --- openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 24 Jul 2018 14:36:27 -0000 1.69 +++ openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 24 Jul 2018 17:18:29 -0000 1.70 @@ -1280,6 +1280,48 @@ return [http -user_id $user_id $href] } + + ad_proc -private detail_link {dict} { + + Create a detail link, which is useful for web-requests, to + inspect the result in case a test fails. + + Missing: cleanup, e.g. after a couple of days, or when the + testcase is executed again (for that we would need testcase_id + and package_key, that we do not want to pass around) + + } { + set nonce REPLY-[clock clicks -microseconds].html + set F [open $::acs::rootdir/packages/acs-automated-testing/www/$nonce w] + puts $F [dict get $dict body] + close $F + return /test/$nonce + } + + ad_proc -public reply_contains {{-prefix ""} dict string} { + Convenience function for test cases + } { + set result [string match *$string* [dict get $dict body]] + if {$result} { + aa_true "${prefix} Reply contains $string (Details)" $result + } else { + aa_true "${prefix} Reply contains $string" $result + } + return $result + } + + ad_proc -public reply_contains_no {{-prefix ""} dict string} { + Convenience function for test cases + } { + set result [string match *$string* [dict get $dict body]] + if {$result} { + aa_false "${prefix} Reply contains no $string (Details)" $result + } else { + aa_false "${prefix} Reply contains no $string" $result + } + return [expr {!$result}] + } + } namespace eval ::acs::test::xpath {