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."
- 0.0.1 "very new"
- 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.
- 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");
- Download the project
- Install node and npm
- Go to the example folder and run
npm install
- Run
node app.js
- Open browser at http://localhost:3000 and follow the instructions
- 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.
- 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.
- 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
Any help, critiscism and comment, even bad ones, are warmly welcomed !