Google Sheet Storage for Test Cases
npm install wingbot-tests-gsheetsFast solution for automated conversation tests
Example testing sheet: https://docs.google.com/spreadsheets/d/1Tl1-NvGO0buR1z1YoB0eYutJ9EdpcXr-DFPuiUxg3Fg/edit#gid=0
``javascript
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));
``
-----------------
Google sheets storage for test cases
objectobjectKind: global class
* TestsGsheet
* new TestsGsheet(sheetId, googleToken)
* .getTestCases() ⇒ Promise.<Array.<TestCase>>
| Param | Type |
| --- | --- |
| sheetId | string |
| googleToken | object |
TestsGsheet object| Name | Type |
| --- | --- |
| step | number |
| rowNum | number |
| action | string |
| passedAction | string |
| textContains | string |
| quickRepliesContains | string |
| stepDescription | string |
object| Name | Type |
| --- | --- |
| list | string |
| name | string |
| steps | Array.<TestCaseStep> |