faq::twt::edit_two (private)

 faq::twt::edit_two faq_name faq_new_name

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

Edits a FAQ from the UI by simulating clicks to the edit page.

Parameters:
faq_name (required)
faq_new_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) twt::do_request twt::do_request (public) faq::twt::edit_two faq::twt::edit_two faq::twt::edit_two->aa_error faq::twt::edit_two->aa_get_first_url faq::twt::edit_two->aa_log faq::twt::edit_two->twt::do_request

Testcases:
No testcase defined.
Source code:
        set response 0

        # Edit the FAQ and request the FAQ Admin page
        # 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"

        # Clic Edit Button
        tclwebtest::form find ~n faq_add_edit
        tclwebtest::form submit
        aa_log " Edit form submitted"

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

        set response_url [tclwebtest::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_new_name"} errmsg] } {
                aa_error  "faq::twt::edit_two failed $errmsg : Don't Edit a Faq"
            } else {
                aa_log "Faq Edited"
                set response 1
            }
        } else {
            aa_error "faq::twt::edit_two failed, bad response url : $response_url"
        }

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