This sample provides a few tests that show why improperly stored state can cause issues. These issues can often be difficult to catch when testing in a development environment simply because they need to be tested with concurrent users and each user may need to be at very specific steps in the dialog in order to cause issues.
There are two sets of tests included in this:
- Testing userProfileDialogNormal, userProfileDialogGlobal, and userProfileDialogProperty:
- From the root of the sample, type
npm run test
. - As the test runs, the console will output a brief description of what each test is doing.
- Read the comments in dialogTests and userProfileTest for more information.
- From the root of the sample, type
- Test your own dialogs for user state issues.
- Finish all of the
TODO:
items in testYourDialog to test your own dialog against multiple, concurrent users.- Adding your dialog: Edit the
require
statement to import your dialog. - Create users for your dialog by editing the
USERS
variable. You may use the existing users or add your own. Ensure there is onebot
and at least two non-bot users. - Create a "transcript" for your user conversations (see below). For best results:
- Each user must initiate the conversation with the bot. The text used is irrelevant.
- The bot's reply must directly follow each user's message.
- Ensure multiple users interact with the bot at the same time at various stages of the dialog (as shown in the example transcript).
- Adding your dialog: Edit the
- Finish all of the
- Run the test from the root of this sample with
npm run testYourDialog
.
The transcript shown in the activities
variable of testYourDialog was generated by speaking with the bot in Emulator with two different users, recording the messages, then merging the conversations from each user into the activities
variable. Here's what the conversations look like in Emulator:
Alfred:
Bernard: