3.0.2 • Published 3 months ago

@ovotech/genesys-web-messaging-tester-cli v3.0.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
3 months ago

Genesys Web Messaging Tester

npm

This tool automatically tests Genesys' Web Messenger Deployments against scenarios in a YAML file. This makes testing:

  • Fast - spot problems with your flow sooner than manually testing
  • Repeatable - scenarios in test scripts are run exactly as defined. Any response that deviates is flagged
  • Customer focused - expected behaviour can be defined as test-script 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/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: Not sure
    - waitForReplyContaining: Sorry I didn't understand you. Please answer with either 'yes' or 'no'
    - waitForReplyContaining: Can we ask you some questions about your experience today?

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 @ovotech/genesys-web-messaging-tester-cli

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

examples/cli/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: Not sure
    - waitForReplyContaining: Sorry I didn't understand you. Please answer with either 'yes' or 'no'
    - waitForReplyContaining: Can we ask you some questions about your experience today?

Then run the test by pointing to the test-script in the terminal:

web-messaging-tester tests/example.yml

Examples

$ web-messaging-tester --help
Usage: web-messaging-tester [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)
  -h, --help                           display help for command

Override Deployment ID and Region in test-script file:

web-messaging-tester test-script.yaml -id 00000000-0000-0000-0000-000000000000 -r xxxx.pure.cloud

Run 10 scenarios in parallel:

web-messaging-tester test-script.yaml --parallel 10

Development

3.0.2

3 months ago

3.0.1

3 months ago

2.0.3

3 months ago

3.0.0-beta.1

3 months ago

3.0.0-beta.0

3 months ago

2.0.2

5 months ago

2.0.0-beta.0

6 months ago

2.0.0

6 months ago

1.0.13-beta.4

9 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.13-beta.2

10 months ago

1.0.13-beta.3

9 months ago

1.0.14

8 months ago

1.0.13-beta.1

10 months ago

1.0.13

9 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.0.5

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago