GithubHelp home page GithubHelp logo

kerrmarin / api-smoke-tests Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 428 KB

A simple web page that takes a bunch of services written in javascript to query a set of web services and display the results (i.e. as a dashboard to check whether they are up or down and showing the responses you are expecting)

License: MIT License

HTML 43.34% JavaScript 56.66%

api-smoke-tests's Introduction

api-smoke-tests

A simple web page that takes a bunch of services written in javascript to query a set of web services and display the results (i.e. as a dashboard to check whether they are up or down)

Install

Clone this repo, create your own service integration and open the index.html page in a web browser.

Usage

Create your own service integration, parse the results you expect from the response and then provide the manager with an object with the following properties:

Services take the following pattern:

var AST = AST || {};

var eventService = {
    name: "Montana flynn",
    id: "montana-flynn",
    request: function(callback) {
        var me = this;
        $.ajax({ url: "https://montanaflynn-dictionary.p.mashape.com/define",
            dataType: "json",
            cache: false,
            crossDomain: true,
            timeout: 5000
        }).done(function(data, textStatus, jqXHR ) {
            me.parse(data, callback);
        }).fail(function(jqXHR, textStatus, errorThrown) {
            callback(false, errorThrown);
        });
    },
    parse: function(response, callback) {
        //Here, parse the results you expect and return an object like:
        //var data = { serviceName: this.name, serviceData: {}, success: Boolean }
        //if(response.isCorrect()) {
        //    callback(true, data);
        //}
    }
};

AST.manager.addService(eventService);
  • status: a boolean, to indicate whether or not the service is responding as expected.
  • serviceName: a string, the name of the service you are querying. This will be output as the title of the panel
  • serviceData: an object, containing the key-value pairs you want to display on the panel's body.

api-smoke-tests's People

Contributors

kerrmarin 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.