diff --git a/.travis.yml b/.travis.yml index 888fa4110..b144196e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,11 @@ install: - npm config set prefix=$HOME/.node_modules - npm install - npm run build + - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 index.html & + - BROWSER_PID=$! + - node start.js test + - node ./bin/test-chrome.js + - kill $BROWSER_PID - popd - rm -rf tools/idea/idea-artifacts/dependencies diff --git a/tests/src/test/js/client.js b/tests/src/test/js/client.js index 78219a5e9..ced3ced9b 100644 --- a/tests/src/test/js/client.js +++ b/tests/src/test/js/client.js @@ -20,7 +20,7 @@ function tryConnect() { let ws = new WebSocket("ws://localhost:9090"); ws.onopen = () => { - console.log("Connected established"); + console.log("Connection established"); listen(ws); }; @@ -30,6 +30,10 @@ function tryConnect() { tryConnect(); }, 500); }; + + ws.onerror = err => { + console.log("Could not connect WebSocket", err); + } } function listen(ws) { @@ -58,12 +62,14 @@ function runTests(ws, suiteId, tests, index) { function runSingleTest(test, callback) { console.log("Running test " + test.name + " consisting of " + test.files); - let iframe = document.getElementById("test"); + let iframe = document.createElement("iframe"); + document.body.appendChild(iframe); let handshakeListener = () => { window.removeEventListener("message", handshakeListener); let listener = event => { window.removeEventListener("message", listener); + document.body.removeChild(iframe); callback(event.data); }; window.addEventListener("message", listener); diff --git a/tests/src/test/js/index.html b/tests/src/test/js/index.html index 36c250b29..580bc3699 100644 --- a/tests/src/test/js/index.html +++ b/tests/src/test/js/index.html @@ -21,6 +21,5 @@
-