Skip to content

Commit

Permalink
Update travis config to add the ui tests to the ci
Browse files Browse the repository at this point in the history
In order to do so, the ui test npm start script was modified to start the server before running the tests. Because the server start and the tests are running asynchronously, the tests are waiting for a valid connection to be up on the host:port of the test server.

Signed-off-by: guy perron <guy.perron@ericsson.com>
  • Loading branch information
lmcgupe committed Jul 10, 2017
1 parent bbf4a5c commit 22e8918
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ branches:
- master
env:
- CXX=g++-4.8
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- oracle-java8-set-default
chrome: stable
before_script:
- export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start
before_install:
- "npm install -g npm@^4"
- "google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &"
script: chmod a+x ./config/scripts/travis-ci-build.sh && ./config/scripts/travis-ci-build.sh
notifications:
webhooks:
Expand Down
5 changes: 3 additions & 2 deletions config/scripts/travis-ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ npm install \
&& npm install \
&& cd ../../examples/browser \
&& npm run bootstrap \
&& npm run test:ui \
&& ps -ef | grep 'node ./src-gen/backend/main.js' | grep -v grep | awk '{print $2}' | xargs kill \
&& cd ../electron \
&& npm run bootstrap \
&& npm run test

&& npm run test
2 changes: 1 addition & 1 deletion examples/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"start:backend": "node ./src-gen/backend/main.js | bunyan",
"start:backend:debug": "node ./src-gen/backend/main.js --loglevel=debug | bunyan",
"start:frontend": "webpack-dev-server --open",
"test:ui": "wdio wdio.conf.js",
"test:ui": "npm run start& wdio --waitforTimeout 300000 wdio.conf.js",
"watch": "concurrently --names watch-deps,watch-frontend --prefix \"[{name}]\" \"npm run watch:localdeps\" \"npm run watch:frontend\"",
"watch:frontend": "npm run build:frontend && webpack --target web --watch",
"watch:localdeps": "ldm watch --sync --run=watch --original-sources"
Expand Down
6 changes: 6 additions & 0 deletions examples/browser/test/panels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ describe('theia main elements loading', () => {

before(() => {
browser.url(url);
if (browser.getTitle() == 'localhost') {
browser.waitUntil(function () {
console.log('browser not loaded yet, trying again ');
return browser.getTitle() == '';
}, 300000), 5000;
}
mainPage = new MainPage(browser);

});
Expand Down
2 changes: 1 addition & 1 deletion examples/browser/theia.package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build:localdeps": "ldm run build && ldm sync --original-sources",
"watch": "concurrently --names watch-deps,watch-frontend --prefix \"[{name}]\" \"npm run watch:localdeps\" \"npm run watch:frontend\"",
"watch:localdeps": "ldm watch --sync --run=watch --original-sources",
"test:ui": "wdio wdio.conf.js"
"test:ui": "npm run start& wdio --waitforTimeout 300000 wdio.conf.js"
},
"devDependencies": {
"@types/chai": "^3.5.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/browser/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ exports.config = {
baseUrl: 'http://localhost:8080',
//
// Default timeout for all waitFor* commands.
waitforTimeout: 10000,
waitforTimeout: 180000,
//
// Default timeout in milliseconds for request
// if Selenium Grid doesn't send response
Expand Down Expand Up @@ -129,7 +129,7 @@ exports.config = {
compilers: ['ts:ts-node/register'],
requires: ['reflect-metadata/Reflect'],
watch: 'ts',
timeout: 10000,
timeout: 180000,

},
//
Expand Down

0 comments on commit 22e8918

Please sign in to comment.