|
@@ -3,7 +3,7 @@
|
|
|
"use strict";
|
|
"use strict";
|
|
|
|
|
|
|
|
const yargs = require('yargs');
|
|
const yargs = require('yargs');
|
|
|
-const uuid = require('uuid');
|
|
|
|
|
|
|
+const { v4 : uuidv4 } = require('uuid');
|
|
|
const express = require('express');
|
|
const express = require('express');
|
|
|
const { chromium, firefox, webkit, devices } = require('playwright');
|
|
const { chromium, firefox, webkit, devices } = require('playwright');
|
|
|
|
|
|
|
@@ -71,6 +71,7 @@ app.post('/command', async (req, res) => {
|
|
|
console.log(type,object,command,args);
|
|
console.log(type,object,command,args);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // XXX this would be cleaner if the mouse() and keyboard() methods just returned a Mouse and Keyboard object
|
|
|
var subject = objects[object];
|
|
var subject = objects[object];
|
|
|
if (subject) {
|
|
if (subject) {
|
|
|
if (type == 'Mouse') {
|
|
if (type == 'Mouse') {
|
|
@@ -91,6 +92,12 @@ app.post('/command', async (req, res) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // XXX videos are special, we have to magic up a guid etc for them
|
|
|
|
|
+ if (command == 'video' && res) {
|
|
|
|
|
+ res._guid = 'Video@' + uuidv4();
|
|
|
|
|
+ res._type = 'Video';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (res && res._guid) {
|
|
if (res && res._guid) {
|
|
|
objects[res._guid] = res;
|
|
objects[res._guid] = res;
|
|
|
}
|
|
}
|