Coder Social home page Coder Social logo

abdulfousan / ivr-tester Goto Github PK

View Code? Open in Web Editor NEW

This project forked from makingchatbots/ivr-tester

0.0 1.0 0.0 2.17 MB

An automated testing framework for Interactive Voice Response (IVR) call flows

Home Page: https://ivr-tester.sketchingdev.co.uk/

License: MIT License

Shell 1.16% JavaScript 0.13% TypeScript 98.71%

ivr-tester's Introduction

IVR Tester

npm Language grade: JavaScript FOSSA Status

Automate the testing of your IVR call flows!

IVR Tester automates the testing of IVR flows by calling them, interpreting prompts and replying with DTMF tones based on fluent test definitions.

Features:

  • Fully automates testing call flows
  • Test multiple scenarios in parallel
  • Expressive test definitions help document call flow
  • Record audio of tests
  • Record transcriptions of tests
  • Supports Google Speech-to-Text and AWS Transcript for transcribing calls
  • Open-source
const config = { transcriber: googleSpeechToText({ languageCode: "en-GB" }) };

new IvrTester(config).run(
  { from: "0123 456 789", to: "0123 123 123" },
  {
    name: "Customer is provided a menu after their account number confirmed",
    steps: [
      {
        whenPrompt: similarTo("Please enter your account number"),
        then: press("184748"),
        silenceAfterPrompt: 3000,
        timeout: 6000,
      },
      {
        whenPrompt: similarTo(
          "press 1 for booking a repair or 2 for changing your address"
        ),
        then: hangUp(),
        silenceAfterPrompt: 3000,
        timeout: 6000,
        },
     ],
  }
);

Quick Start

  1. Create a Twilio account (referral link for $10 free if you upgrade), load it with money and rent a phone number
    1. Store an authentication token in environment variables:
    export TWILIO_ACCOUNT_SID=ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    export TWILIO_AUTH_TOKEN=your_auth_token
  2. Configure your environment for either Google or Amazon's transcription service
  3. Install and start ngrok
    npm install ngrok -g
    ngrok http 8080
  4. Run the tests
    # Local port that IVR Tester will listen on
    export LOCAL_SERVER_PORT=8080
    # URL that ngrok exposes to the outside world
    export PUBLIC_SERVER_URL=$(curl -s localhost:4040/api/tunnels | jq -r .tunnels[0].public_url)
    
    node test.js

How it works

Under the hood this orchestrates:

  1. Establishing a bi-directional audio stream of the call to the IVR flow - using Twilio
  2. Transcribing the voice responses from the flow - using Google Speech-to-Text
  3. Using the test to conditionally respond with DTMF tones to transcripts

Writing tests

When Overview
contains Prompt contains a piece of text
matches Prompt matches regular expression
similarTo Prompt is similar to a piece of text
isAnything Prompt can be anything
Then Overview
press Produces DTMF tones
hangUp Terminates the call
doNothing Doesn't do anything

Development

Documentation

Where possible the documentation is generated from the code using the following script in the root directory or individual packages:

yarn docs

The documentation is automatically generated and committed as part of the CI pipeline when merged to the main branch.

The official website can be previewed locally by running:

docsify serve docs

License

FOSSA Status

ivr-tester's People

Contributors

abdulfousan avatar dependabot[bot] avatar fossabot avatar sketchingdev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.