In the console, function testing can be used to directly initiate a function invocation, simulate a triggering event sent by the trigger, and display the function execution conditions, return content, and log.On the function details page in the console, you can test run a function by clicking Test in the function code tab.
During product iteration, new content will be added to the default testing event templates.
A testing event template is used to simulate the event and content passed to a function when the corresponding trigger triggers the function, which is represented as the
event input parameter in the function. The template must be a data structure in JSON format. The default testing event templates and their descriptions are as follows:
Before testing, you can directly select a default test template or modify the test template based on your own event conditions and save it as a custom test template. The modified test template passes the event content that is used as function trigger to the function and must be in JSON format.
The following usage restrictions apply to custom testing event templates.
When testing, if you do not want to modify the testing template every time, you can save the modified template as a custom template. After selecting the template to be modified, you can click Create Template to modify the template, enter an easy-to-remember name, and save it. When using the saved template for testing subsequently, the template on the testing page will be the same as that used last time.
You can delete a custom template that is no longer used by selecting it and clicking Delete.