Coder Social home page Coder Social logo

nndi-oss / dialoguss Goto Github PK

View Code? Open in Web Editor NEW
15.0 9.0 9.0 95 KB

CLI tool for testing HTTP based USSD applications

Home Page: https://nndi.cloud/oss/dialoguss/

License: MIT License

Go 100.00%
ussd cli testing integration-testing africastalking golang tnm-ussd ussd-applications

dialoguss's Introduction

Dialoguss

dialoguss is a cli tool to test USSD applications that are implemented as HTTP services - particularly those implemented via:

dialoguss is useful for testing your USSD applications during development.

It can be used in two ways:

  1. You can simulate a session and interact with that session via a simple CLI based interface or,
  2. You can describe the steps required for a session and automate the session, i.e. automated testing

Usage

dialoguss requires a YAML file to run. The file describes one application and has to contain atleast url to the application, dial the USSD shortcode for your app and a phoneNumber to use for the session tests.

For the automated dialogue tests you are required to define steps which describe the sequence of steps for one USSD session. Steps define the text to send to the USSD application and the expected output after sending that text.

Please refer to the examples below:

Interactive Dialogue

# app.yaml
url: http://localhost:9000/ussd
dial: *123*1234#
phoneNumber: 265888123456
$ dialoguss -i -f app.yaml
Sending *123*1234# to <app>
USSD Response:
What is your name?
> name: Zikani

Hello Zikani, choose an item:
1. Account detail
2. Balance
3. Something else
# Exit
> 2

Your balance is: MK 500
> ok

Automated Dialogue

# app.yml
url: http://localhost:7654
dial: "*1234*1234#"
# 'global' phone number, overriden per session
phoneNumber: 265888123456
sessions:
  - id: 12345678910
    phoneNumber: 265888123456
    description: "Should return a balance of 500 for Zikani"
    steps:
      # The first step is the response after dialing the ussd code
      - expect: "What is your name?"
      - userInput: "Zikani"
        expect: |-
          Welcome, Zikani
          Choose an item:
          1. Account detail
          2. Balance
          3. Something else
          # Exit
      - userInput: "2" 
        expect: "Your balance is: MK 500"
$ dialoguss -f app.yml
All steps in session 12345678910 run successfully

Why should I use this?

Glad you asked! Well, mostly this tool will help you reduce costs related to testing your USSD applications. The current approach for testing your applications could be to upload the code to your server, pull out your phone and dial the USSD service code linked to your application.

That's too much work and costs you time and monies!

You should use this if you'd like to test your application before deploying it to production.


Copyright (c) 2018 - 2020, NNDI

dialoguss's People

Contributors

eliassiweni42 avatar kamikazechaser avatar kwalter94 avatar sevenreup avatar sharkfoursix avatar zikani03 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dialoguss's Issues

Use kong for building CLI commands

Refactor the code to use kong for building and parsing the command-line args.
This is a potentially backward incompatible change but will enable us to add other functionality to the program.

The command line should support the following subcommands initially

$ dialoguss version

$ dialoguss simulate [--file FILE] [--url URL] [--phone PHONE]

$ dialoguss run --file FILE [default:dialoguss.yml]

Support referencing steps as components to enable re-usability

Support referencing components to enable re-usability.

steps:
  - id: 1234567891011
    phoneNumber: 265888123456
    description: "Should return list of visited locations"
    steps:
      - expect: "#/components/steps/initial"
      - userInput: "2"
      
components:
  steps:
    initial: |-
      Welcome
      1. Choose a location
      2. View previous locations
      #. Exit

Generate SVG preview from a session

Users should be able to generate a preview of a session as an animated SVG file. Within the animation each screen should be animated in and out, the animation will loop on itself. On screens that expect user input, it would nice to show a "typing" animation for the input.

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.