Skip to content

Commit

Permalink
feat(tests): add protractor scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
balthazar committed Feb 27, 2015
1 parent 0015c70 commit 906c324
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/templates/client/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
exports.config = {

// The version is susceptible to change
seleniumServerJar: '../node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.44.0.jar',
//chromeDriver: '../node_modules/gulp-protractor/node_modules/protractor/selenium/chromedriver',

baseUrl: 'http://localhost:9000',

chromeOnly: true,

capabilities: {
'browserName': 'chrome'
},

framework: 'jasmine',

jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}

};
11 changes: 11 additions & 0 deletions app/templates/client/views/home/home.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('home page', function () {

describe('basic', function () {
browser.get('/');

it('should have a basic content', function () {
expect(element.all(by.css('div')).first().getText()).toBe('HomeCtrl');
});
});

});
14 changes: 14 additions & 0 deletions app/templates/client/views/login(auth)/login.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe('login page', function () {

describe('basic', function () {
browser.get('/login');

it('should have two login inputs', function (done) {
element.all(by.css('input')).then(function (inputs) {
expect(inputs.length).toBe(2);
done();
});
});
});

});
14 changes: 14 additions & 0 deletions app/templates/client/views/signup(auth)/signup.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe('signup page', function () {

describe('basic', function () {
browser.get('/signup');

it('should have two signup inputs', function (done) {
element.all(by.css('input')).then(function (inputs) {
expect(inputs.length).toBe(2);
done();
});
});
});

});
16 changes: 16 additions & 0 deletions app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,22 @@ gulp.task('control', function () {
.pipe($.jshint.reporter('default'));
});


/**
* Protractor
*/
gulp.taks('e2e:update', $.protractor.webdriver_update);

gulp.task('e2e:run', ['serve'], function () {
return gulp.src('client/views/**/*.e2e.js')
.pipe($.protractor.protractor({
configFile: 'client/protractor.conf.js'
}))
.on('error', function (e) {
console.log(e);
});
});

/**
* Tests
*/
Expand Down
1 change: 1 addition & 0 deletions app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"gulp-nodemon": "^1.0.5",
"gulp-open": "^0.3.2",
"gulp-plumber": "^0.6.6",
"gulp-protractor": "^0.0.12",
"gulp-replace": "^0.5.2",
"gulp-rev-all": "^0.7.6",
"gulp-sass": "^1.3.2",
Expand Down

0 comments on commit 906c324

Please sign in to comment.