forked from webdriverio/selenium-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
25 lines (23 loc) · 753 Bytes
/
test.js
File metadata and controls
25 lines (23 loc) · 753 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
25
describe('programmatic use', function () {
it('should start', function(done) {
this.timeout(20000);
var timedout;
var selenium = require('./index.js');
var proc = selenium.start({ stdio: 'pipe' });
// since selenium 2.43.1, selenium now outputs its info log on stderr
['stderr', 'stdout'].forEach(function(output) {
proc[output].on('data', function seleniumSays(data) {
var line = data.toString().trim();
if (line.indexOf('Started SocketListener on 0.0.0.0:4444') > -1) {
proc.kill();
clearTimeout(timedout);
done();
}
})
});
timedout = setTimeout(function() {
proc.kill();
done(new Error('Server never started'));
}, 20000);
})
});