Testing the Bot

It's simple

We made testing bots as simple as possible. Our testing tool provides methods for simulating

const { Tester } = require('wingbot');
const assert = require('assert');
const bot = require('../botRoot');

describe('/bot', function () {

    it('should work', async function () {
        const t = new Tester(bot);

        await t.postBack('/start'); // send the postback

        t.passedAction('start');   // check, that action passed

            .contains('Hello')     // check the text response

        await t.quickReply('continue'); // select the quick reply


        await t.text('Show me the goods!');

            .templateType('generic'); // look for generic template

        // check the state
        assert.strictEqual(t.getState().seenGoods, true, 'seenGoods has to be true');


results matching ""

    No results matching ""