Open rjgmail88 opened 6 years ago
Why not try the following:
[
{
out: "schedule a meeting"
},
{
in: "Who will be attending?",
},
{
out: "blah blah"
},
{
in: "I didn't understand that"
},
// and so on
];
Hey, as I said it's not going to test actual logic to determine if "blah blah" is person name. Its purely write your expected and unexpected array & BotTester to process your test array and no logical testing. In my case when user says 'John' I am using MS graph to resolved it to my closest John in the network.
@morsh , Is this project just about unit testing of alarm-bot ? or this project does have alarm-bot capabilities along with unit testing ? I'm confused because I looked in bot.js which has real dialogs like help, set_alarm and are you unite testing those with arrays from [../dialog/flows..] directories.
Sorry If I'm unclear but in my project I have a following dialog which is triggered by LUIS.
var builder = require('botbuilder');
module.exports = function(bot) {
bot.dialog('Help', function (session) {
builder.Prompts.text(session, `I can help you to schedule a meeting, reschedule or cancel
existing);
session.endDialog();
}).triggerAction({
matches: 'Help'
});
}
in order to follow according to alarm-bot-unit-testing I had to create bot.js and recreate same dialog in bot.js. even though my projects existing app.js file has all root dialogs,cortana default dialogs etc. So I wonder if bot.js from alarm-bot-unit-testing is actually a test dialog file.
@rjgmail88 - in order to test the dialog, you need to abstract the dialog logic from the code connecting this logic to the bot framework service. For this you need to implement an app.js + bot.js in a similar way like the sample. Notice: this is an old sample using botbuilder version < 4.0, and is mainly used as a reference on how to add unit tests to a bot application.
Thanks @morsh . Do you have any latest example anywhere I can refer to. I implemented my testing same was as this project does but, i feel LUIS mock isnt working. My test runs even though I comment luis-mock.js file.
@rjgmail88 - sorry, but I don't know any other repos/articles regarding testing of bots.
@morsh, do you have or know any similar testing capabilities for botbuilder v4 nodejs sdk ? I am looking for writing some unit tests for dialogs for my bot built in v4 node sdk.
@rjgmail88 - sorry, but I no longer maintain this repo
Hi, I have gone over this example and understood how its nicely doing unite testing as expected. However, I do see it more or less just running the expected array from the files under /dialog-flows with some specific code pattern and not actually testing real dialogs or conversation flow. Ex: I have a bot for meeting scheduling where flow looks like as follows
how do I test my dialog if user say 'blah blah' when asked by bot "Who will be attending?" Creating an expected array in /dialog-flows and just running through BotTester doesn't really test BOT logic and code.