wingbot-tests-gsheets

1.4.1 • Public • Published

Google Sheet Storage for Test Cases

Fast solution for automated conversation tests

Example testing sheet: https://docs.google.com/spreadsheets/d/1Tl1-NvGO0buR1z1YoB0eYutJ9EdpcXr-DFPuiUxg3Fg/edit#gid=0

Usage

const { ConversationTester } = require('wingbot');
const { TestsGsheet } = require('wingbot-jwt');
const googleToken = require('./my-google-token.json');

function botFactory (forTests = false) {
    const bot = new Router();

    // your bot here

    return bot;
}

const testsStorage = new TestsGsheet('sheet-id', googleToken);
const tester = new ConversationTester(testsStorage, botFactory);

tester.test()
    .then((res) => console.log(res.output))
    .catch((e) => console.error(e));

API

Classes

TestsGsheet

Google sheets storage for test cases

Typedefs

TestCaseStep : object
TestCase : object

TestsGsheet

Google sheets storage for test cases

Kind: global class

new TestsGsheet(sheetId, googleToken)

Param Type
sheetId string
googleToken object

testsGsheet.getTestCases() ⇒ Promise.<Array.<TestCase>>

Kind: instance method of TestsGsheet

TestCaseStep : object

Kind: global typedef
Properties

Name Type
step number
rowNum number
action string
passedAction string
textContains string
quickRepliesContains string
stepDescription string

TestCase : object

Kind: global typedef
Properties

Name Type
list string
name string
steps Array.<TestCaseStep>

Package Sidebar

Install

npm i wingbot-tests-gsheets

Weekly Downloads

11

Version

1.4.1

License

MIT

Unpacked Size

26.7 kB

Total Files

12

Last publish

Collaborators

  • wingbot.ai
  • zdehasek