faq::twt::insert_after_Q_A (private)

 faq::twt::insert_after_Q_A faq_name

Defined in packages/faq/tcl/test/tclwebtest-procs.tcl

Inserts a Question/Answer after another existing one from the UI.

Parameters:
faq_name (required)

Partial Call Graph (max 5 caller/called nodes):
%3 aa_error aa_error (public) aa_get_first_url aa_get_first_url (public) aa_log aa_log (public) ad_generate_random_string ad_generate_random_string (public) db_1row db_1row (public) faq::twt::insert_after_Q_A faq::twt::insert_after_Q_A faq::twt::insert_after_Q_A->aa_error faq::twt::insert_after_Q_A->aa_get_first_url faq::twt::insert_after_Q_A->aa_log faq::twt::insert_after_Q_A->ad_generate_random_string faq::twt::insert_after_Q_A->db_1row

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 "insert after"

        set question [ad_generate_random_string]
        set answer [ad_generate_random_string]

        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] } {
            tclwebtest::link follow "delete"
            if { [catch {tclwebtest::assert text "$question"} errmsg] } {
                aa_error "faq::twt::insert_after_Q_A :  failed $errmsg : Don't Insert After a Question"
            } else {
                aa_log "Faq Question inserted after another"
                set response 1
            }
        } else {
            aa_error "faq::twt::insert_after_Q_A failed. Bad  response url : $response_url"
        }

        return $response
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: