1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-25 14:10:42 +02:00

Tests now load repository web

This commit is contained in:
Luis
2017-04-24 16:04:37 +02:00
parent 68eae7952a
commit 71e7913a64

View File

@@ -4,13 +4,17 @@ import test from 'ava';
let ph_, page_, status_;
const load = async () => {
await phantom.create().then(async ph => {
const log = console.log;
const nolog = function() {};
await phantom.create([], { logger: { warn: log, debug: nolog, error: log } }
).then(async ph => {
ph_ = ph;
return await ph_.createPage();
}).then(page => {
page_ = page;
return page_.open('http://webslides.tv/');
}).then(status => {
return page_.open('file:///'+__dirname.replace(/\\/g, '/')+'/../../index.html');
}).then(async status => {
const content = await page_.property('content');
status_ = status;
return true;
}).catch(e => console.log(e));