npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@makingchatbots/genesys-cloud-chatbot-tester-cli

v3.0.6

Published

[![npm](https://img.shields.io/npm/v/@makingchatbots/genesys-cloud-chatbot-tester-cli)](https://www.npmjs.com/package/@makingchatbots/genesys-cloud-chatbot-tester-cli) [![Follow me on LinkedIn for updates](https://img.shields.io/badge/Follow%20for%20updat

Readme

Genesys Cloud Chatbot Tester CLI

npm Follow me on LinkedIn for updates

Allows behaviour for Genesys Chatbots and Architect flows behind Genesys' Web Messenger Deployments to be automatically tested using:

  • Scripted Dialogue - I say "X" and expect "Y" in response (example)
  • Generative AI - Converse with my chatbot and fail the test if it doesn't do "X" (examples)

Why? Well it makes testing:

  • Fast - spot problems with your chatbots sooner than manually testing
  • Repeatable - scenarios in scripted dialogues are run exactly as defined. Any response that deviates is flagged
  • Customer focused - expected behaviour can be defined as scenarios before development commences
  • Automatic - being a CLI tool means it can be integrated into your CI/CD pipeline, or run on a scheduled basis e.g. to monitor production

Demo of tool executing two scenarios that pass

The above test is using the test-script:

examples/cli-scripted-tests/example-pass.yml

config:
  deploymentId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  region: xxxx.pure.cloud
scenarios:
  "Accept Survey":
    - say: hi
    - waitForReplyContaining: Can we ask you some questions about your experience today?
    - say: 'Yes'
    - waitForReplyMatching: Thank you! Now for the next question[\.]+
  "Decline Survey":
    - say: hi
    - waitForReplyContaining: Can we ask you some questions about your experience today?
    - say: 'No'
    - waitForReplyContaining: Maybe next time. Goodbye
  "Provide Incorrect Answer to Survey Question":
    - say: hi
    - waitForReplyContaining: Can we ask you some questions about your experience today?
    - say: Example
    - waitForReplyContaining: Sorry. Please input "Yes" or "No". Do you want to proceed?

How it works

The tool uses Web Messenger's guest API to simulate a customer talking to a Web Messenger Deployment. Once the tool starts an interaction it follows instructions defined in a file called a 'test-script', which tells it what to say and what it should expect in response. If the response deviates from the test-script then the tool flags the test as a failure, otherwise the test passes.

Tool using test-script file to test Web Messenger Deployment

Quick Start

Prepare your system by installing node

Install the CLI tool using npm:

npm install -g @makingchatbots/genesys-cloud-chatbot-tester-cli

Testing with scripted dialogues

Write a dialogue script containing all the scenarios you wish to run along with the ID and region of your Web Messenger Deployment.

examples/cli-scripted-tests/example-pass.yml

config:
  deploymentId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  region: xxxx.pure.cloud
scenarios:
  "Accept Survey":
    - say: hi
    - waitForReplyContaining: Can we ask you some questions about your experience today?
    - say: 'Yes'
    - waitForReplyMatching: Thank you! Now for the next question[\.]+
  "Decline Survey":
    - say: hi
    - waitForReplyContaining: Can we ask you some questions about your experience today?
    - say: 'No'
    - waitForReplyContaining: Maybe next time. Goodbye
  "Provide Incorrect Answer to Survey Question":
    - say: hi
    - waitForReplyContaining: Can we ask you some questions about your experience today?
    - say: Example
    - waitForReplyContaining: Sorry. Please input "Yes" or "No". Do you want to proceed?

Then run the test by pointing to the dialogue script file in the terminal:

genesys-cloud-chatbot-tester scripted tests/example.yml

Testing with AI

This tool supports two GenAI providers:

  • ChatGPT (gpt-3.5-turbo by default)
  • Google Gemini (gemini-2.0-flash by default)

Using ChatGPT

Start by setting up an API key for ChatGPT:

  1. Create an API key for OpenAI
  2. Set the key in the environment variable: OPENAI_API_KEY

Write a scenario file containing all the scenarios you wish to run along with the ID and region of your Web Messenger Deployment.

The scenarios are written as prompts, these can take some fine-tuning to get right (see examples here). The terminatingPhrases section defines the phrases you instruct ChatGPT to say to pass or fail a test.

examples/cli-ai-tests/chatgpt-example.yml

config:
  deploymentId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  region: xxxx.pure.cloud
  ai:
    provider: chatgpt
    config:
      temperature: 1
scenarios:
  "Accept survey":
    setup:
      placeholders:
        NAME:
          - John
          - Jane
      prompt: |
        I want you to play the role of a customer called {NAME}, talking to a company's online chatbot. You must not
        break from this role, and all of your responses must be based on how a customer would realistically talk to a company's chatbot.

        To help you play the role of a customer consider the following points when writing a response:
        * Respond to questions with as few words as possible
        * Answer with the exact word when given options e.g. if asked to answer with either 'yes' or 'no' answer with either 'yes' or 'no' without punctuation, such as full stops

        As a customer you would like to leave feedback of a recent purchase of a light bulb you made where a customer service
        rep was very helpful in finding the bulb with the correct fitting.

        If at any point in the company's chatbot repeats itself then say the word 'FAIL'.

        If you have understood your role and the purpose of your conversation with the company's chatbot then say the word 'Hello'
        and nothing else.
      terminatingPhrases:
        pass: ["PASS"]
        fail: ["FAIL"]

Then run the AI test by pointing to the scenario file in the terminal:

genesys-cloud-chatbot-tester ai tests/example.yml

For a slightly more detailed guide see: Let's test a Genesys chatbot with AI.

Using Google Gemini

  1. Set environment variables for Gemini API key, or Gemini API on Vertex AI
  2. Define a prompt to provide the model with context on how to behave during testing

The terminatingPhrases section defines the phrases you instruct the model to return to pass or fail a test.

examples/cli-ai-tests/google-gemini-example.yml

config:
  ai:
    provider: google-gemini
    config:
      model: "gemini-2.0-flash"
scenarios:
  "Accept survey":
    setup:
      prompt: |
        I want you to play the role of a customer talking to a company's online chatbot. You must not
        break from this role, and all of your responses must be based on how a customer would realistically talk to a company's chatbot.

        To help you play the role of a customer consider the following points when writing a response:
        * Respond to questions with as few words as possible
        * Answer with the exact word when given options e.g. if asked to answer with either 'yes' or 'no' answer with either 'yes' or 'no' without punctuation, such as full stops

        As a customer you would like to leave feedback of a recent purchase of a light bulb you made where a customer service
        rep was very helpful in finding the bulb with the correct fitting.

        If at any point in the company's chatbot repeats itself then say the word 'FAIL'.

        If you have understood your role and the purpose of your conversation with the company's chatbot then say the word 'Hello'
        and nothing else.
      terminatingPhrases:
        pass: ["PASS"]
        fail: ["FAIL"]

Then run the AI test by pointing to the scenario file in the terminal:

genesys-cloud-chatbot-tester ai tests/example.yml

Example commands

$ genesys-cloud-chatbot-tester scripted --help
Usage: genesys-cloud-chatbot-tester scripted [options] <filePath>

Arguments:
  filePath                             Path of the YAML test-script file

Options:
  -id, --deployment-id <deploymentId>  Web Messenger Deployment's ID
  -r, --region <region>                Region of Genesys instance that hosts the Web Messenger Deployment
  -o, --origin <origin>                Origin domain used for restricting Web Messenger Deployment
  -p, --parallel <number>              Maximum scenarios to run in parallel (default: 1)
  -a, --associate-id                   Associate tests their conversation ID.
                                       This requires the following environment variables to be set for an OAuth client
                                       with the role conversation:webmessaging:view:
                                       GENESYS_REGION
                                       GENESYSCLOUD_OAUTHCLIENT_ID
                                       GENESYSCLOUD_OAUTHCLIENT_SECRET (default: false)
  -fo, --failures-only                 Only output failures (default: false)
  -t, --timeout <number>               Seconds to wait for a response before
                                       failing the test (default: 10)
  -h, --help                           display help for command

Override Deployment ID and Region in test-script file:

genesys-cloud-chatbot-tester scripted test-script.yaml -id 00000000-0000-0000-0000-000000000000 -r xxxx.pure.cloud

Run 10 scenarios in parallel:

genesys-cloud-chatbot-tester scripted test-script.yaml --parallel 10

Support

If you have any questions then please feel free to:

Development