Http Backend
Http backend mock module for protractor
Installation
npm install httpbackend
include angular mock script https://github.com/angular/bower-angular-mocks
Simple Usage
var HttpBackend = ;var backend = null; ;
Advanced Usage
Workflow
HttpBackend workflow is quite simple:
- On browser.get()` a mock module is injected to your angularjs application
- On
when*
or when you call manuallybackend.sync()
, fixtures is synchronised with your angularjs app.
Increase perfomance
For perfomance issue you can disable auto sync:
var backend = brower autoSync: false; //Then you should manually call sync function backend; backend; backend;
Httpbackend Methods
when GET, POST, HEAD, PUT, JSONP
add a fixtures, accept literal object, or a callbacksync
, manualy sync fixturesclear
, clear http backend modulereset
, reset all fixture
Development and test
Init project
bower installnpm install
Update Webdriver (used by Grunt)
./node_modules/.bin/webdriver-manager update
Launch test
npm test
Licence
MIT