Conversation
|
I'll need more background here certainly. Can you provide an example of how this feature would be used. If something needed to tweak or consolidate payload depending on HTTP Headers, I would opt for a proxy architecture, such as the one I created for the webhook-affinity proxy If a bot test framework was to be built, I would suggest to add an instrumentation mode (which is certainly close to the BOT_UNDER_TEST env proposed here), so that the emulator would send real-time notifications, or may be add some kind of "monitor feature" like Spark has for Cisco internal needs. Again let's start from a sample of what needs to be achieved. |
|
Here's a project with an example: https://github.com/jpjpjp/bot-test-framework-example |
ObjectIsAdvantag
left a comment
There was a problem hiding this comment.
I finally got more time to dig into this PR
Now looking at the best way to integrate 3rd party middleware to the emulator, so that the bot-test tool could integrate incremental updates & fixes from the emulator.
I see 2 possible approaches:
- the emulator is turned to a library, and delivered to npm
- or a dynamically loaded middleware strategy is added (similarly to the botkit-template with plugins support: https://github.com/CiscoDevNet/botkit-template/tree/plugin)
|
Note: I've integrated the non bot-test related parts of the PR:
|
There was a problem hiding this comment.
About:
POST /messages create a new message.
I am not getting this mention, since this is not a Webex feature. If it something specific to the bot-test module ?
If the payload includes a personId, will create a new one on one space if one does not already exist. (personEmail not yet supported)
Added the ability to run the emulator in "bot test mode" if the environment BOT_UNDER_TEST is set to an email of one of the identities specified in tokens.json. When this occurs the emulator will intercept responses sent to test requests that have an X-Bot-Responses header. It will wait until it gets requests from the BOT_UNDER_TEST and build a consolidate response body so that that a test framework can inspect the bot requests that were generated in response to any given test input.