Skip to content

Commit

Permalink
ng e2e test for Angular 6 (fixes #1436) (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
empeje authored and paulbert committed Jul 3, 2018
1 parent 7d4f958 commit 8e4ed79
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ _use_chrome: &_use_chrome
packages:
- google-chrome-stable
- google-chrome-beta
- jq
_use_nodejs: &_use_nodejs
language: node_js
node_js:
Expand Down Expand Up @@ -94,7 +95,7 @@ jobs:
- set -e
- echo "Waiting for couchdb to start"; WAIT_TIME=0; until curl http://127.0.0.1:5984/_all_dbs || [ $WAIT_TIME -eq 180 ]; do echo "..."; sleep 5; WAIT_TIME=$(expr $WAIT_TIME + 5); done
- i=$(curl -X GET http://127.0.0.1:5984/_all_dbs | jq length); if [ $i -ne 20 ]; then exit 1; fi
- ng e2e --environment test
- ng e2e
- stage: docker-release
<<: *_prepare_deploy
script: #x86 tagging
Expand Down
2 changes: 1 addition & 1 deletion .travis/travis_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ prepare_ci(){
DOCKER_ORG=treehouses
DOCKER_REPO=planet-tags
DOCKER_REPO_TEST=planet-test
VERSION=$(cat package.json | grep version | awk '{print$2}' | awk '{print substr($0, 2, length($0) - 3)}')
VERSION=$(jq '.version' package.json | sed -e 's/^"//' -e 's/"$//')
BRANCH=$TRAVIS_BRANCH
COMMIT=${TRAVIS_COMMIT::8}
REMOTE_MASTER_HASH=$(git ls-remote https://github.com/open-learning-exchange/planet.git | grep refs/heads/master | cut -f 1)
Expand Down
2 changes: 2 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Vagrant.configure(2) do |config|
sudo docker run -d -p 5984:5984 --name planet -v /srv/data/bell:/opt/couchdb/data -v /srv/log/bell:/opt/couchdb/var/log/ treehouses/couchdb:2.1.1
# Install Angular CLI
#sudo npm install -g @angular/cli
sudo npm install -g webdriver-manager
# Add CORS to CouchDB so app has access to databases
#git clone https://github.com/pouchdb/add-cors-to-couchdb.git
Expand All @@ -108,6 +109,7 @@ Vagrant.configure(2) do |config|
chown vagrant:vagrant /vagrant_node_modules
mount --bind /vagrant_node_modules /vagrant/node_modules
npm i --unsafe-perm
sudo npm run webdriver-set-version
# End node_modules fix
# Add initial Couch databases here
Expand Down
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "ang-bell-app:serve"
"devServerTarget": "ang-bell-app:serve:test"
}
},
"lint": {
Expand Down
2 changes: 1 addition & 1 deletion e2e/login.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Login', () => {
passInput.sendKeys('e2e');
page.clickSignin();
browser.getCurrentUrl().then((url) => {
expect(url).toEqual('http://0.0.0.0:49152/');
expect(url).toEqual('http://localhost:4200/');
});
});

Expand Down
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,25 @@
"lint-all": "npm run sass-lint && ng lint ang-bell-app --type-check && npm run htmlhint",
"v-lint": "vagrant ssh -- -t 'cd /vagrant;npm run lint -s'",
"v-lint-fix": "vagrant ssh -- -t 'cd /vagrant;ng lint ang-bell-app --fix --type-check'",
"e2e": "ng e2e --environment test",
"v-e2e": "vagrant ssh -- -t 'cd /vagrant;ng e2e --environment test'",
"install-hooks": "cp -a git-hooks/. .git/hooks/"
"e2e": "ng e2e --webdriver-update=false",
"v-e2e": "vagrant ssh -- -t 'cd /vagrant;ng e2e --webdriver-update=false'",
"install-hooks": "cp -a git-hooks/. .git/hooks/",
"webdriver-set-version": "webdriver-manager update --standalone false --gecko false --versions.chrome 2.37"
},
"private": true,
"dependencies": {
"@angular/animations": "6.0.3",
"@angular/cdk": "^6.0.0",
"@angular/common": "6.0.3",
"@angular/compiler": "6.0.3",
"@angular/core": "6.0.3",
"@angular/forms": "6.0.3",
"@angular/material": "^6.0.0",
"@angular/platform-browser": "6.0.3",
"@angular/platform-browser-dynamic": "6.0.3",
"@angular/platform-server": "6.0.3",
"@angular/router": "6.0.3",
"@angular/service-worker": "6.0.3",
"@angular/animations": "6.0.7",
"@angular/cdk": "^6.3.1",
"@angular/common": "6.0.7",
"@angular/compiler": "6.0.7",
"@angular/core": "6.0.7",
"@angular/forms": "6.0.7",
"@angular/material": "^6.3.1",
"@angular/platform-browser": "6.0.7",
"@angular/platform-browser-dynamic": "6.0.7",
"@angular/platform-server": "6.0.7",
"@angular/router": "6.0.7",
"@angular/service-worker": "6.0.7",
"@types/cropperjs": "^1.1.2",
"core-js": "^2.5.1",
"cropperjs": "^1.3.4",
Expand All @@ -50,8 +51,8 @@
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.6",
"@angular/cli": "^6.0.7",
"@angular/compiler-cli": "6.0.3",
"@angular/language-service": "6.0.3",
"@angular/compiler-cli": "6.0.7",
"@angular/language-service": "6.0.7",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
Expand Down

0 comments on commit 8e4ed79

Please sign in to comment.