Git Product home page Git Product logo

buster-server-cli's Introduction

buster-server-cli

Build status

Command-line interface API for running ramp instances with a simple interface that allows capturing and viewing a list of connected browsers.

In Buster, this module is the implementation of the buster server command. It does not define the binary however, as it is intended to be generic enough to be reused outside of Buster.

Possible use cases

The capture server is the central piece in Buster's multiple browser automation capabilities. This module can be used as is to run tests for any framework, as it does not know anything about tests at all. However, if you're shipping a capture server for your own framework, you may want to brand your server a little.

The following example shows how to create a custom capture server for the fictional checkit test framework.

The binary

// checkit/bin/checkit-server
var path = require("path");
var serverCli = require("buster-server-cli");

serverCli.create(process.stdout, process.stderr, {
    missionStatement: "Checkit crazy multi-browser test runner server",
    description: "checkit-server [options]",
    templateRoot: path.join(__dirname, "..", "views"),
    documentRoot: path.join(__dirname, "..", "public")
}).run(process.argv.slice(2));

The index template

You need to define two templates for the server to work correctly. The first one is index.ejs, which is an ejs template for the index page of the server. Buster's index template renders a list of captured browsers and a link to /capture, which is the URL that causes the browser to become a captured slave.

The index.ejs template is rendered with one piece of data โ€” slaves โ€” which is an array of slave objects:

  • slave.browser A string, i.e. "Firefox"
  • slave.platform A string, i.e. "Linux"
  • slave.version A string, i.e. "12.0"
  • slave.os A string, contains a richer OS/platform description
  • slave.userAgent The original user agent

The header template

The second template is the header.ejs template. It is used in the top frame in the frameset that is displayed in captured slaves. Currently this is just a static template, but future versions will expose an API to communicate with the server here to display progress etc.

See Buster's header template for a reference implementation.

Changelog

0.4.0 (2015-Nov-28)

  • Upgraded all dependencies
  • Replaced paperboy with serve-static

0.3.4 (2015-Mar-16)

0.3.3 (2015-Mar-12)

0.3.2 (2015-Jan-23)

0.3.1 (2014-Sep-17)

buster-server-cli's People

Contributors

augustl avatar cjohansen avatar dominykas avatar dwittner avatar gcheung55 avatar mroderick avatar sdepold avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

buster-server-cli's Issues

Use template-literal instead of EJS

Template Literal is fastest, smallest and simplest template engine, because it use JS's literal template feature.

It's 55 times faster than EJS, and it also use less CPU and RAM ressources, so it may be a good idea to use it instead of EJS ๐Ÿ˜€

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.