Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ui tests to travis ci #284

Merged
merged 2 commits into from
Jul 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion examples/browser/test/pages/main-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class MainPage {
}

public isFileNavigatorOpen(): Boolean {
if (this.driver.element('#file-navigator').getAttribute('class').split(' ').indexOf('p-mod-hidden') !== -1) {
if (this.driver.element('#files').getAttribute('class').split(' ').indexOf('p-mod-hidden') !== -1) {
return false;
} else {
return true;
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