Index: openacs-4/packages/xowiki/tcl/test/test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/test-procs.tcl,v diff -u -r1.15.2.26 -r1.15.2.27 --- openacs-4/packages/xowiki/tcl/test/test-procs.tcl 18 Jan 2022 17:17:02 -0000 1.15.2.26 +++ openacs-4/packages/xowiki/tcl/test/test-procs.tcl 18 Jan 2022 17:50:35 -0000 1.15.2.27 @@ -546,6 +546,24 @@ acs::test::reply_has_status_code $d 302 } + ad_proc ::xowiki::test::get_content {d} { + + Retrieve form a result dict of a request just the xowiki + content part, denoted by the div with class 'xowiki-content' + (i.e., leave out the header and footer). + + @return HTML with xowiki content or empty, iof not there + } { + acs::test::dom_html root [dict get $d body] { + set xowiki_content [$root selectNodes {//div[@class='xowiki-content']}] + if {$xowiki_content ne ""} { + set xowiki_content [$xowiki_content asHTML] + } + } + return $xowiki_content + } + + } # Index: openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl,v diff -u -r1.1.2.62 -r1.1.2.63 --- openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 18 Jan 2022 17:11:08 -0000 1.1.2.62 +++ openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 18 Jan 2022 17:50:35 -0000 1.1.2.63 @@ -393,14 +393,15 @@ "::acs::test::user::create" "::export_vars" "::lang::system::locale" + "::xowiki::Page instproc www-create-new" + "::xowiki::Page instproc www-edit" "::xowiki::test::create_form" "::xowiki::test::create_form_page" "::xowiki::test::edit_form_page" + "::xowiki::test::get_content" "::xowiki::test::get_form_CSSclass" "::xowiki::test::get_object_name" "::xowiki::test::require_test_folder" - "::xowiki::Page instproc www-create-new" - "::xowiki::Page instproc www-edit" "::ad_log" "::ad_return_complaint" @@ -697,17 +698,18 @@ [export_vars -base $instance/$testfolder/$page_name $extra_url_parameter]] acs::test::reply_has_status_code $d 200 - set response [dict get $d body] - acs::test::dom_html root $response { + #ns_log notice CONTENT=[::xowiki::test::get_content $d] + + acs::test::dom_html root [::xowiki::test::get_content $d] { set id_part [string map {: _} $page_name] set input1 [$root getElementById F.$id_part.txt.1] set input2 [$root getElementById F.$id_part.txt.2] + aa_log "input1 '$input1' input2 '$input2'" aa_equals "input1 (1st element of repeated field)" [$input1 getAttribute value] t1 aa_equals "input2 (2nd element of repeated field)" [$input2 getAttribute value] t2 } - } on error {errorMsg} { aa_true "Error msg: $errorMsg" 0 } finally {