mercredi 14 juin 2017

Keep nodeJs server running while executing the rest of tests

im new to nodeJS and webdriveIO writing some webdriveIO tests i have two functions: smsServer(); and startTest();

1- smsServer();

function smsServer(){
// parse application/x-www-form-urlencoded 
app.use(bodyParser.urlencoded({ extended: false }))
// parse application/json 
app.use(bodyParser.json())
app.get('/',function(req,res){
    console.log(req.query.text);
});
app.post('/', function(req,res){
    console.log("Post");
    console.log(req.body);
    res.sendStatus(200);
});
app.listen(3000, function(req, res){
console.log('App listening on localhost:3000');
console.log("req: ",req);
console.log("res: ",res);
});
}

2- startTest(); just some Test WDIO

i want to keep my server running to recieve some verification codes while the second function (tests) executing any help will be appreciated before my boss kills me

Aucun commentaire:

Enregistrer un commentaire