-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.env.js
More file actions
24 lines (23 loc) · 770 Bytes
/
.env.js
File metadata and controls
24 lines (23 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var childProcess = require('child_process');
var chromedriver = require('chromedriver');
var psTree = require('ps-tree');
module.exports = {
"user" : "admin",
"password" : "password",
before : function(done) {
this.chromedriverInstance = childProcess.exec('xvfb-run ' + chromedriver.path);
done();
},
after : function(done) {
if (this.chromedriverInstance != null){
psTree(this.chromedriverInstance.pid, function (err, children) {
childProcess.spawn('kill', ['-9'].concat(children.map(function (p) { return p.PID })));
});
}
done();
},
beforeEach: function( browser, done ) {
var page = browser.page.WordPressHelper();
page.login();
}
};