# wingbot-tests-gsheets

> Google Sheet Storage for Test Cases

Latest version **1.4.2** (published 2024-07-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install wingbot-tests-gsheets
pnpm add wingbot-tests-gsheets
yarn add wingbot-tests-gsheets
bun add wingbot-tests-gsheets
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.2 |
| Published | 2024-07-19 |
| First published | 2019-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 2 |
| Unpacked size | 26.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | wingbot.ai |
| Maintainers | wingbot.ai, lika85456 |
| Keywords | wingbot, google, sheets, chatbot, testing, storage, tests |

## Links

- npm: https://www.npmjs.com/package/wingbot-tests-gsheets
- Repository: https://github.com/wingbotai/wingbot-tests-gsheets
- Homepage: https://github.com/wingbotai/wingbot-tests-gsheets#readme
- Issues: https://github.com/wingbotai/wingbot-tests-gsheets/issues
- npm.io page: https://npm.io/package/wingbot-tests-gsheets

## Dependencies (2)

- [google-spreadsheet](https://npm.io/package/google-spreadsheet.md) ^4.1.1
- [google-auth-library](https://npm.io/package/google-auth-library.md) ^9.4.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.4.2 (latest) — 2024-07-19
- 1.2.4-alpha.1 (next) — 2021-02-15
- 1.4.1 — 2024-01-05
- 1.4.0 — 2023-01-12
- 1.3.2 — 2022-09-13
- 1.3.1 — 2021-05-19
- 1.3.0 — 2021-04-22
- 1.2.4 — 2021-02-15
- 1.2.3 — 2020-05-22
- 1.2.2 — 2020-05-21
- 1.2.1 — 2020-05-21
- 1.2.0 — 2020-05-20
- 1.1.0 — 2020-01-08
- 1.1.0-alpha.2 — 2020-01-08
- 1.1.0-alpha.1 — 2020-01-08
- … 2 more at https://npm.io/package/wingbot-tests-gsheets/versions

## README

# 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

```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));
```

-----------------

# API
## Classes

<dl>
<dt><a href="#TestsGsheet">TestsGsheet</a></dt>
<dd><p>Google sheets storage for test cases</p>
</dd>
</dl>

## Typedefs

<dl>
<dt><a href="#TestCaseStep">TestCaseStep</a> : <code>object</code></dt>
<dd></dd>
<dt><a href="#TestCase">TestCase</a> : <code>object</code></dt>
<dd></dd>
</dl>

<a name="TestsGsheet"></a>

## TestsGsheet
Google sheets storage for test cases

**Kind**: global class  

* [TestsGsheet](#TestsGsheet)
    * [new TestsGsheet(sheetId, googleToken)](#new_TestsGsheet_new)
    * [.getTestCases()](#TestsGsheet+getTestCases) ⇒ <code>Promise.&lt;Array.&lt;TestCase&gt;&gt;</code>

<a name="new_TestsGsheet_new"></a>

### new TestsGsheet(sheetId, googleToken)

| Param | Type |
| --- | --- |
| sheetId | <code>string</code> | 
| googleToken | <code>object</code> | 

<a name="TestsGsheet+getTestCases"></a>

### testsGsheet.getTestCases() ⇒ <code>Promise.&lt;Array.&lt;TestCase&gt;&gt;</code>
**Kind**: instance method of [<code>TestsGsheet</code>](#TestsGsheet)  
<a name="TestCaseStep"></a>

## TestCaseStep : <code>object</code>
**Kind**: global typedef  
**Properties**

| Name | Type |
| --- | --- |
| step | <code>number</code> | 
| rowNum | <code>number</code> | 
| action | <code>string</code> | 
| passedAction | <code>string</code> | 
| textContains | <code>string</code> | 
| quickRepliesContains | <code>string</code> | 
| stepDescription | <code>string</code> | 

<a name="TestCase"></a>

## TestCase : <code>object</code>
**Kind**: global typedef  
**Properties**

| Name | Type |
| --- | --- |
| list | <code>string</code> | 
| name | <code>string</code> | 
| steps | [<code>Array.&lt;TestCaseStep&gt;</code>](#TestCaseStep) |

---
_Source: https://npm.io/package/wingbot-tests-gsheets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
