Git Product home page Git Product logo

testling's Introduction

testling

Write tests for the browser or node.

Run them with local browsers or hosted browsers from testling.com.

example

Just write a simple test:

var test = require('testling');

test('json parse', function (t) {
    t.same(JSON.parse('[1,2]'), [1,2]);
    t.log('beep boop');
    t.end();
});

then run it with a local browser:

$ testling example/test.js --browser=chrome
>> beep boop
TAP version 13
# json parse
ok 1 should be equivalent

1..1
# tests 1
# pass  1

# ok

Your local browsers will be detected using browser-launcher.

To see a list of detected local browsers, do testling list:

$ testling list
chrome/17.0.963.12
chromium/18.0.1025.168
phantom/1.4.0
firefox/12.0

To run your test on remote testling browsers, first open a testling tunnel:

$ testling tunnel
# ssh -NR 57594:localhost:54046 [email protected]
Enter passphrase for key '/home/substack/.ssh/id_dsa': 

then do:

$ testling example/test.js --browser=testling.chrome/12.0
>> beep boop
TAP version 13
# json parse
ok 1 should be equivalent

1..1
# tests 1
# pass  1

# ok

test api

var test = require('testling')

The test api is just the node-tap api plus:

t.createWindow(uri, vars, cb)

Return a schoolbus object to drive around web pages.

t.log(msg)

Log a message to the output.

command-line usage

Usage:

  testling tunnel
  testling list
  testling OPTIONS [test files]

testling tunnel

  Open a testling ssh tunnel. This step is necessary before using testling
  browsers.
  
testling list

  List local available browsers.

testling OPTIONS [test files]

  Run the test files in the given browser.
  
  OPTIONS:

    --browser   Run the tests with this browser. Prepend 'testling.' to run your
                tests in a testling remote browser.
                Full browser list: http://testling.com/browsers.json

    --headless  For local browsers, run in headless mode.
                Requires that you have the `Xvfb` command in $PATH.

install

With npm just do:

npm install -g testling

attack of the testlings!

testling's People

Contributors

raynos avatar widged avatar

Watchers

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