Commit 4817442a authored by Tom JORQUERA's avatar Tom JORQUERA
Browse files

Merge branch '52-split-robot-js-for-test' into 'master'

selenium arg give has argument

Closes #52

See merge request !44
parents a5012f1f 283ae9d5
Pipeline #5067 passed with stage
in 48 seconds
...@@ -25,12 +25,10 @@ ...@@ -25,12 +25,10 @@
/* global robot:true robotController robotLib MediaRecorder */ /* global robot:true robotController robotLib MediaRecorder */
/* exported robot */ /* exported robot */
const room = arguments[0];
const config = arguments[1];
robotController.external.load(config);
robot = { robot = {
// The variable 'room' and 'clientConfig' will be initialized at the call of start function
room: '',
clientConfig: {},
previousReco: [], previousReco: [],
recordedParticipantsWS: {}, recordedParticipantsWS: {},
participantsMediaRecorders: {}, participantsMediaRecorders: {},
...@@ -88,7 +86,7 @@ robot = { ...@@ -88,7 +86,7 @@ robot = {
console.log(formattedReco); console.log(formattedReco);
if (formattedReco !== '') { if (formattedReco !== '') {
robotController.sendMessage(config.name, config.avatar, formattedReco); robotController.sendMessage(robot.config.name, robot.config.avatar, formattedReco);
} }
}, },
...@@ -97,7 +95,7 @@ robot = { ...@@ -97,7 +95,7 @@ robot = {
console.log('> ' + e.text); console.log('> ' + e.text);
robotLib.reco.send( robotLib.reco.send(
{ {
from: room, from: robot.room,
text: e.from + '\t' + e.until + '\t' + easyrtcid + '\t' + e.text text: e.from + '\t' + e.until + '\t' + easyrtcid + '\t' + e.text
}); });
}); });
...@@ -149,10 +147,13 @@ robot = { ...@@ -149,10 +147,13 @@ robot = {
} }
}, },
start: () => { start: (room, clientConfig) => {
robotLib.stt = robotLib.stt(config); robot.room = room;
robotLib.reco = robotLib.reco(config); robot.clientConfig = clientConfig;
robotLib.archive = robotLib.archive(config);
robotLib.stt = robotLib.stt(robot.clientConfig);
robotLib.reco = robotLib.reco(robot.clientConfig);
robotLib.archive = robotLib.archive(robot.clientConfig);
robotController.onAttendeePush = (e, data) => { robotController.onAttendeePush = (e, data) => {
if (data.easyrtcid === robotController.getMyId()) { if (data.easyrtcid === robotController.getMyId()) {
...@@ -174,7 +175,7 @@ robot = { ...@@ -174,7 +175,7 @@ robot = {
onConnection: () => { onConnection: () => {
const recoStartRetry = () => { const recoStartRetry = () => {
if (robotLib.reco.start(room)) { if (robotLib.reco.start(robot.room)) {
clearInterval(robot.recoInterval); clearInterval(robot.recoInterval);
} }
}; };
...@@ -182,7 +183,7 @@ robot = { ...@@ -182,7 +183,7 @@ robot = {
robot.intervalList.push(robot.recoInterval); robot.intervalList.push(robot.recoInterval);
robot.intervalList.push( robot.intervalList.push(
setInterval(() => robotLib.reco.getOnlineReco(room) setInterval(() => robotLib.reco.getOnlineReco(robot.room)
.then(robot.processReco) .then(robot.processReco)
.catch(console.error), .catch(console.error),
8000)); 8000));
......
...@@ -42,13 +42,19 @@ module.exports = config => ({ ...@@ -42,13 +42,19 @@ module.exports = config => ({
.then(() => resolveSequentially(f => client.execute(f, room, clientConfig), .then(() => resolveSequentially(f => client.execute(f, room, clientConfig),
controllerFilesList)) controllerFilesList))
.then(() => console.log('runner: modules resolved')) .then(() => console.log('runner: modules resolved'))
.then(() => client.execute(() => { .then(() => client.execute(clientConfig =>
/* eslint-disable no-undef */
robotController.external.load(clientConfig), clientConfig)
/* eslint-enable */
)
.then(() => console.log('runner: external loaded'))
.then(() => client.execute((room, clientConfig) => {
setTimeout(() => { setTimeout(() => {
/* eslint-disable no-undef */ /* eslint-disable no-undef */
robot.start(); robot.start(room, clientConfig);
/* eslint-enable */ /* eslint-enable */
}, 500); }, 500);
})) }, room, clientConfig))
.then(() => console.log('runner: robot started')) .then(() => console.log('runner: robot started'))
.setValue('#displayname', clientConfig.name) .setValue('#displayname', clientConfig.name)
.click('.btn') .click('.btn')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment