Giter VIP home page Giter VIP logo

blackboxjs's Introduction

WEBSITE

Blackbox testing framework of any Single Page Application written in JS.

"a functionnal test tool of a single page application should correctly check both input (eg. visual content) and output (eg. REST calls) of the system under test."

Version

  • 0.0.1 "very new"

Motivation

  • Main motivation : a functionnal test tool of a single page application should correctly check both input (visual content) and output (REST calls) of the system under test.
  • Functionnal testing should be easy to read and write, so that businness and devs can talk about it.
  • Such a tool must be technology agnostic, so that the functionnal test suite could be kept "as is" when upgrading or changing MVC framework.

Docs

  • BlackboxJS is a fork of ngScenario, so all docs about how to install, how to run, etc, applies.
  • Input : User event should be fired with the jQueryFunction, see the sample in the example/restful/_test directory. There is also an attempt to fire any keyboard event, for example :
 fireEnterOn('input#new-todo');
  • Output : All matchers of the original ngScenarios works, so the official docs apply. Moreover, you can test which last XHR request was sent :
expect(lastRequest("POST").body()).toEqual({
            "title": "anotherTodo",
            "completed": false,
            "id": 4
        });

There is also an adapter for localStorage

expect(windowLocalStorage("todos-" + QueryString.fw).getItem()).not().toContain("editing");

Run the examples

  1. Download the project
  2. Install node and npm
  3. Go to the example folder and run npm install
  4. Run node app.js
  5. Open browser at http://localhost:3000 and follow the instructions

Limitations

  • The system under test runs in a iframe, which could be sometime a problem.
  • Mouse gesture can not be simulated
  • As of now, only MVC frameworks that integrates nicely with jQuery can use the tool.

Credits

  • BlackboxJS is a fork from ngScenario. However, ngScenario can not be used outside the Angular world. The tool has been hacked so that any javascript application could be blackbox-tested.
  • Samples under test are all part of the TodoMVC project.
  • Example page theme from brainy.io.

TODOs :

  • Extends the matchers so that any JS object can be easily asserted
  • Find a way to trigger the events without jQuery
  • Build a website with demo

Final word

Any help, critiscism and comment, even bad ones, are warmly welcomed !

blackboxjs's People

Contributors

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