a smart signin simulator and test accounts switcher base on Node
$ npm install poker
// require poker
var Poker = require('poker');
// init a poker
// watch out replace passport from keywords
var poker = new Poker('http://abc.com/signin');
// add test account and then signin
poker.add({
alias: 'testAccountNo.1',
username: 'abc',
password: '123'
}).mock(function(err, res, result){
console.log(result)
});
// add as much accounts as you like
poker.add(
[{
alias: 'testAccountNo.1',
username: 'abc',
password: '123'
},{
alias: 'testAccountNo.2',
username: 'admin',
password: '21212'
},{
alias: 'testAccountNo.3',
username: 'sqwsqws',
password: '112312323'
}]);
// switch to selected user will signin automatically
poker.mock('testAccountNo.1',function(err, res, result){
console.log(result);
});
- multiple test accounts supported
- account quick switch supported
- cookie supported
- fork this repo
- feel free to add your feature
- make sure your feature are fully tested!
- send me a PR, and enjoy !