BotBuilder-Samples icon indicating copy to clipboard operation
BotBuilder-Samples copied to clipboard

Samples should include SetTestOptionsMiddleware

Open chrimc62 opened this issue 5 years ago • 1 comments

A convenient way to generate a test is to generate a transcript using the emulator and then turn that transcript into a test script. The issue is that randomness in bots makes it impossible to replay a transcript. In order to fix this, the SDK has:

Defined SetTestOptionsMiddleware in Adaptive.Testing to pick up a SetTestOptions custom event and copy the payload into conversation.testOptions. We made the payload open ended. Defined randomSeed to seed a random number generator or randomValue to return a constant value from all calls to random and adjusted all users of random to make use of that. Defined a bf plugin that converts a transcript into a test script that supports the history and mocking.

Samples should include SetTestOptionsMiddleware so that when a transcript is recorded with a bot you can control randomness.

chrimc62 avatar Aug 24 '20 18:08 chrimc62

@chrimc62 Moved this from https://github.com/microsoft/BotFramework-Samples/ to https://github.com/microsoft/BotBuilder-Samples/

EricDahlvang avatar Aug 24 '20 18:08 EricDahlvang