Skip to content

Commit

Permalink
Merge pull request #3 from lexith/master
Browse files Browse the repository at this point in the history
Basic E2E Test Setup using Protractor
  • Loading branch information
matthias-schuetz committed Jul 3, 2016
2 parents a106410 + f4f463b commit 112c5e4
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 4 deletions.
11 changes: 11 additions & 0 deletions app/src/app.component.spec.e2e.ts
@@ -0,0 +1,11 @@
describe('App', () => {

beforeEach( () => {
browser.get('/');
});

it('should have a title', () => {
expect(browser.getTitle()).toEqual('Angular 2 Seed [using RC3] - Minimalistic TypeScript starter project');
});

});
4 changes: 4 additions & 0 deletions package.json
Expand Up @@ -29,6 +29,10 @@
"gulp-typescript": "^2.10.0",
"gulp-uglify": "^1.5.3",
"gulp-watch": "^4.3.5",
"jasmine-core": "^2.4.1",
"jasmine-spec-reporter": "^2.5.0",
"phantomjs": "^2.1.7",
"protractor": "^3.3.0",
"run-sequence": "^1.1.5",
"systemjs-builder": "^0.15.19",
"tslint": "^3.11.0",
Expand Down
48 changes: 48 additions & 0 deletions protractor.conf.js
@@ -0,0 +1,48 @@
exports.config = {

baseUrl: 'http://localhost:8080/',

/*
* Set to direct connect if tests are run locally (only Chrome / Firefox)
*/
// directConnect: true,

/*
* Set seleniumAddress to phantomJS Ghost instance
* Usage: node node_modules/phantomjs/bin/phantomjs --webdriver=4444
*/
seleniumAddress: 'http://localhost:4444',

/*
* Set seleniumAddress to webdriver-manager default when using other browsers
* Usage: webdriver-manager start
*/
// seleniumAddress: 'http://localhost:4444/wd/hub',

specs: [
'./app/src/**/*.spec.e2e.js'
],

framework: 'jasmine',

jasmineNodeOpts: {
showColors: true
},

capabilities: {
// browserName: 'chrome'

'browserName': 'phantomjs',
'phantomjs.binary.path': './node_modules/phantomjs/bin/phantomjs',
'phantomjs.cli.args': ['--logfile=PATH', '--loglevel=DEBUG']
},

onPrepare: function() {
const SpecReporter = require('jasmine-spec-reporter');
jasmine.getEnv().addReporter(new SpecReporter({ displayStacktrace: 'all' }));

browser.ignoreSynchronization = false;
},

useAllAngular2AppRoots: true
};
11 changes: 7 additions & 4 deletions typings.json
Expand Up @@ -3,8 +3,11 @@
"version": false,
"dependencies": {},
"globalDependencies": {
"es6-collections": "registry:dt/es6-collections#0.5.1+20160316155526",
"es6-promise": "registry:dt/es6-promise#0.0.0+20160423074304",
"node": "registry:dt/node#4.0.0+20160423143914"
"angular-protractor": "github:DefinitelyTyped/DefinitelyTyped/angular-protractor/angular-protractor.d.ts#64b25f63f0ec821040a5d3e049a976865062ed9d",
"es6-collections": "registry:dt/es6-collections#0.5.1+20160316155526",
"es6-promise": "registry:dt/es6-promise#0.0.0+20160423074304",
"node": "registry:dt/node#4.0.0+20160423143914",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#26c98c8a9530c44f8c801ccc3b2057e2101187ee",
"selenium-webdriver": "github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#a83677ed13add14c2ab06c7325d182d0ba2784ea"
}
}
}

0 comments on commit 112c5e4

Please sign in to comment.