Skip to content

Commit

Permalink
Merge pull request #3 from getgauge-contrib/1_handle_new_windowOpen
Browse files Browse the repository at this point in the history
#1 handle new tab or window open
  • Loading branch information
sriv authored Apr 14, 2019
2 parents 7c2e00c + 60874ff commit 1b0c6cd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs'),
path = require('path');

var _deviceWidth, _deviceHeight, _client, _outFile, _frames = [];
var _deviceWidth, _deviceHeight, _client, _outFile,_eventHandler, _frames = [];

var _mkdirp = (p) => {
if (!fs.existsSync(p)){
Expand Down Expand Up @@ -31,6 +31,10 @@ var start = async (outFile) => {
_deviceHeight = frame.metadata.deviceHeight;
_frames.push(frame.data);
});
_eventHandler.once('createdSession', (client) => {
_client = client;
start(_outFile);
});
await resume();
};

Expand Down Expand Up @@ -81,9 +85,10 @@ var stop = async () => {
encoder.finish();
};

var clientHandler = async (taiko) => {
var clientHandler = async (taiko, eventHandler) => {
_client = taiko.client();
}
_eventHandler = eventHandler;
};

module.exports = {
'ID' : 'screencast',
Expand Down

0 comments on commit 1b0c6cd

Please sign in to comment.