Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Yoann HOUPERT
hublot
Commits
6d5fbfdb
Commit
6d5fbfdb
authored
Sep 14, 2017
by
Tom Jorquera
Browse files
add some logs and avoid exiting too soon
parent
c3ff14a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
app.js
app.js
+8
-0
lib/runner.js
lib/runner.js
+12
-2
No files found.
app.js
View file @
6d5fbfdb
...
...
@@ -3,8 +3,11 @@ const config = require('./config.json');
const
runner
=
require
(
'
./lib/runner.js
'
)(
config
.
runner
);
const
controller
=
require
(
'
./lib/controller.js
'
)(
'
./client
'
);
console
.
log
(
'
starting hublot...
'
);
controller
.
loadAll
(
'
controller
'
,
'
lib
'
,
'
robot
'
)
.
then
(
modules
=>
{
console
.
log
(
'
modules loaded... launching runner
'
);
// Note: result can be stored in a variable to control further the browser
// e.g.: let client = runner.run(...); client.end();
runner
.
run
(
modules
,
config
.
visio
.
url
,
'
test-bot
'
,
config
.
client
);
...
...
@@ -12,3 +15,8 @@ controller.loadAll('controller', 'lib', 'robot')
.
catch
(
err
=>
{
console
.
error
(
err
);
});
// Hang
(
function
wait
()
{
setTimeout
(
wait
,
10000
);
})();
lib/runner.js
View file @
6d5fbfdb
...
...
@@ -10,11 +10,18 @@ function resolveSequentially(f, elements) {
module
.
exports
=
config
=>
({
run
:
(
controllerFilesList
,
server
,
room
,
clientConfig
)
=>
{
console
.
log
(
'
runner is up
'
);
const
client
=
webdriverio
.
remote
(
config
.
driver
);
console
.
log
(
'
runner created client
'
);
return
client
.
init
()
.
then
(()
=>
console
.
log
(
'
runner: client started
'
))
.
url
(
server
+
'
/
'
+
room
)
.
then
(()
=>
console
.
log
(
'
runner: connecting to url
'
))
.
waitForVisible
(
'
#displayname
'
,
30000
)
.
then
(()
=>
console
.
log
(
'
runner: displayname visible
'
))
.
then
(()
=>
resolveSequentially
(
f
=>
client
.
execute
(
f
,
room
,
clientConfig
),
controllerFilesList
))
.
then
(()
=>
console
.
log
(
'
runner: modules resolved
'
))
.
then
(()
=>
client
.
execute
(()
=>
{
setTimeout
(()
=>
{
/* eslint-disable no-undef */
...
...
@@ -22,9 +29,12 @@ module.exports = config => ({
/* eslint-enable */
},
500
);
}))
.
waitForVisible
(
'
#displayname
'
,
30000
)
.
then
(()
=>
console
.
log
(
'
runner: robot started
'
)
)
.
setValue
(
'
#displayname
'
,
clientConfig
.
name
)
.
click
(
'
.btn
'
)
.
waitForExist
(
'
//div[@video-id="video-thumb8"]
'
,
30000
);
.
then
(()
=>
console
.
log
(
'
runner: button clicked
'
))
.
waitForExist
(
'
//div[@video-id="video-thumb8"]
'
,
30000
)
.
then
(()
=>
console
.
log
(
'
runner: video exists
'
))
.
catch
(
err
=>
console
.
log
(
'
runner: error %j
'
,
err
));
}
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment