faq::twt::new (private)

 faq::twt::new faq_name

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

Adds a FAQ from the UI.

Parameters:
faq_name

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) twt::do_request twt::do_request (public) faq::twt::new faq::twt::new faq::twt::new->aa_error faq::twt::new->aa_get_first_url faq::twt::new->aa_log faq::twt::new->twt::do_request

Testcases:
No testcase defined.
Source code:
        set response 0
        # The Faq page url
        set faq_page_url [aa_get_first_url -package_key faq]
        ::twt::do_request $faq_page_url

        # Create a new FAQ
        tclwebtest::link follow "administer"
        tclwebtest::link follow    "Create a new FAQ"

        tclwebtest::form find ~n "faq_add_edit"
        tclwebtest::field find ~n "faq_name"
        tclwebtest::field fill "$faq_name"
        tclwebtest::form submit
        aa_log "Faq form submitted"

        set response_url [tclwebtest::response url]

        aa_log "$response_url"
        if {[string match "*admin/one-faq*" $response_url] } {
            if { [catch {tclwebtest::form find ~n "faq_add_edit"} errmsg] || [catch {tclwebtest::field find ~v "$faq_name"} errmsg] } {
                aa_error  "faq::twt::new failed $errmsg : Don't create a New Faq"
            } else {
                aa_log "New faq Created !!"
                set response 1
            }
        } else {
            aa_error "faq::twt::new failed, bad response url : $response_url"
        }

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