Implement front calls in a test
Implementing a custom front call in your test.
In this task you implement a custom front call that overloads the default front call implementation to return the name of the front-end.
Testing with Ghost ClientFront calls | Parent topic: Front calls |
Implementing a custom front call in your test.
In this task you implement a custom front call that overloads the default front call implementation to return the name of the front-end.
FUNCTION myCustomFrontCall (request ggc.FrontCallRequest INOUT) RETURNS ggc.FrontCallAnswer
See the sample function implementation of standard.feInfo("feName")
in Example: custom front call (BDL).
play
is called.
MAIN
block of your
scenario:MAIN
# Register custom front call handler
CALL ggc.registerFrontCallHandler(FUNCTION myCustomFrontCall)
# ...
CALL play()
EXIT PROGRAM 0
END MAIN
For example, a menu action:
MAIN
DEFINE answer STRING
OPEN FORM f FROM "frontcall"
DISPLAY FORM f
MENU "FrontCall"
ON ACTION fename
CALL ui.Interface.frontcall("standard","feinfo", ["fename"],[answer])
MESSAGE answer
ON ACTION quit
EXIT MENU
END MENU
END MAIN
play
function of your scenario test the action (
fename
in the example ).
FUNCTION play()
DEFINE msg ggc.Message
CALL ggc.action("fename")
CALL ggc.getMessage() RETURNING msg.*
DISPLAY msg.message
...
END FUNCTION