faq::twt::new_Q_A (private)
faq::twt::new_Q_A faq_name question answer
Defined in packages/faq/tcl/test/tclwebtest-procs.tcl
Creates a new Question/Answer from the UI.
- Parameters:
- faq_name (required)
- question (required)
- answer (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set response 0 db_1row faq_id "select faq_id from faqs where faq_name=:faq_name" # The Faq page url set faq_page_url [aa_get_first_url -package_key faq] ::twt::do_request $faq_page_url tclwebtest::link follow "administer" tclwebtest::link follow $faq_name tclwebtest::link follow "Create New Q&A" tclwebtest::form find ~n "new_quest_answ" tclwebtest::field find ~n "question" tclwebtest::field fill "$question" tclwebtest::field find ~n "answer" tclwebtest::field fill "$answer" tclwebtest::form submit aa_log " Faq Question Form submitted" set response_url [tclwebtest::response url] if { [string match "*admin/one-faq*" $response_url] } { if { [catch {tclwebtest::assert text "$question"} errmsg] } { aa_error "faq::twt::new_Q_A : failed $errmsg : Don't Create New Question" } else { aa_log "New Faq Question Created" set response 1 } } else { aa_error "faq::twt::new_Q_A failed. Bad response url : $response_url" } return $responseXQL Not present: Generic, PostgreSQL, Oracle