Commit 0a1475c4 authored by Yoann HOUPERT's avatar Yoann HOUPERT

selenium arg give has argument

parent a5012f1f
Pipeline #4870 passed with stage
in 42 seconds
......@@ -25,12 +25,9 @@
/* global robot:true robotController robotLib MediaRecorder */
/* exported robot */
const room = arguments[0];
const config = arguments[1];
robotController.external.load(config);
robot = {
room: '',
clientConfig: {},
previousReco: [],
recordedParticipantsWS: {},
participantsMediaRecorders: {},
......@@ -88,7 +85,7 @@ robot = {
console.log(formattedReco);
if (formattedReco !== '') {
robotController.sendMessage(config.name, config.avatar, formattedReco);
robotController.sendMessage(robot.config.name, robot.config.avatar, formattedReco);
}
},
......@@ -97,7 +94,7 @@ robot = {
console.log('> ' + e.text);
robotLib.reco.send(
{
from: room,
from: robot.room,
text: e.from + '\t' + e.until + '\t' + easyrtcid + '\t' + e.text
});
});
......@@ -149,10 +146,13 @@ robot = {
}
},
start: () => {
robotLib.stt = robotLib.stt(config);
robotLib.reco = robotLib.reco(config);
robotLib.archive = robotLib.archive(config);
start: (room, clientConfig) => {
robot.room = room;
robot.clientConfig = clientConfig;
robotLib.stt = robotLib.stt(robot.clientConfig);
robotLib.reco = robotLib.reco(robot.clientConfig);
robotLib.archive = robotLib.archive(robot.clientConfig);
robotController.onAttendeePush = (e, data) => {
if (data.easyrtcid === robotController.getMyId()) {
......@@ -174,7 +174,7 @@ robot = {
onConnection: () => {
const recoStartRetry = () => {
if (robotLib.reco.start(room)) {
if (robotLib.reco.start(robot.room)) {
clearInterval(robot.recoInterval);
}
};
......@@ -182,7 +182,7 @@ robot = {
robot.intervalList.push(robot.recoInterval);
robot.intervalList.push(
setInterval(() => robotLib.reco.getOnlineReco(room)
setInterval(() => robotLib.reco.getOnlineReco(robot.room)
.then(robot.processReco)
.catch(console.error),
8000));
......
......@@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* global robot:true robotController */
const webdriverio = require('webdriverio');
// Utility function to resolve a list of promise-based function calls
......@@ -42,13 +44,13 @@ module.exports = config => ({
.then(() => resolveSequentially(f => client.execute(f, room, clientConfig),
controllerFilesList))
.then(() => console.log('runner: modules resolved'))
.then(() => client.execute(() => {
.then(() => client.execute(clientConfig => robotController.external.load(clientConfig), clientConfig))
.then(() => console.log('runner: external loaded'))
.then(() => client.execute((room, clientConfig) => {
setTimeout(() => {
/* eslint-disable no-undef */
robot.start();
/* eslint-enable */
robot.start(room, clientConfig);
}, 500);
}))
}, room, clientConfig))
.then(() => console.log('runner: robot started'))
.setValue('#displayname', clientConfig.name)
.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