-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64f533b
commit 64aeaff
Showing
8 changed files
with
109 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,55 @@ | ||
var coffee, gulp, uglify; | ||
'use strict'; | ||
|
||
gulp = require( 'gulp' ); | ||
coffee = require( 'gulp-coffee' ); | ||
uglify = require( 'gulp-uglify' ); | ||
var del = require('del'); | ||
var gulp = require('gulp'); | ||
var coffee = require('gulp-coffee'); | ||
var uglify = require('gulp-uglify'); | ||
var protractor = require('gulp-protractor').protractor; | ||
|
||
gulp.task( 'js', function () { | ||
|
||
gulp.task('clean', function(cb) { | ||
del(['build'], cb); | ||
}); | ||
|
||
/** | ||
* CoffeeScript Source Files | ||
*/ | ||
gulp.task('js', function () { | ||
gulp | ||
.src( './app/scripts/**/*.coffee' ) | ||
.pipe( coffee({ | ||
.src('./app/scripts/**/*.coffee') | ||
.pipe(coffee({ | ||
bare: true | ||
}) ) | ||
.pipe( uglify() ) | ||
.pipe( gulp.dest( './.tmp/scripts' ) ); | ||
} ); | ||
gulp.task( 'js:test', function () { | ||
gulp | ||
.src( './test/**/*.coffee' ) | ||
.pipe( coffee({ | ||
})) | ||
.pipe(uglify()) | ||
.pipe(gulp.dest('./.tmp/scripts')); | ||
}); | ||
|
||
/** | ||
* CoffeeScript Test Files | ||
*/ | ||
gulp.task('js:test', function () { | ||
gulp.src('./test/**/*.coffee') | ||
.pipe(coffee({ | ||
bare: true | ||
}) ) | ||
.pipe( gulp.dest( './.tmp' ) ); | ||
} ); | ||
|
||
gulp.task( 'watch', function () { | ||
gulp.watch( './app/scripts/**/*.coffee', ['js'] ); | ||
gulp.watch( './test/**/*.coffee', ['js:test'] ) | ||
} ); | ||
})).pipe(gulp.dest('./.tmp')); | ||
}); | ||
|
||
gulp.task('watch', function () { | ||
gulp.watch('./app/scripts/**/*.coffee', ['js']); | ||
gulp.watch('./test/**/*.coffee', ['js:test']) | ||
}); | ||
|
||
|
||
|
||
|
||
gulp.task('test', ['js:test'], function(){ | ||
gulp.src(['./.tmp/protractor/**/*-spec.js']) | ||
.pipe(protractor({ | ||
configFile: 'protractor.conf.js' | ||
})) | ||
.on('error', function (e) { | ||
throw e; | ||
}); | ||
}); | ||
|
||
gulp.task('default', ['js:test', 'test']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
###* | ||
J$ Helpers - I am test helpers | ||
### | ||
j$ = | ||
element: (selector, label) -> | ||
console.warn('finding', label) if label | ||
$(selector) | ||
input: (name) -> | ||
element(protractor.By.css("[name=#{name}]")).getWebElement() | ||
|
||
module.exports = j$ | ||
module.exports = | ||
element: (selector, label) -> | ||
console.warn('finding', label) if label | ||
$(selector) | ||
input: (name) -> | ||
element(protractor.By.css("[name=#{name}]")).getWebElement() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
|
||
###* | ||
App Page - I handle general actions in the app. | ||
### | ||
AppPage = | ||
title: $('.navbar-brand') | ||
get: -> | ||
browser.get '/' | ||
title: $('.navbar-brand') | ||
get: -> | ||
browser.get '/#' | ||
refresh: -> | ||
browser.refresh() | ||
|
||
module.exports = AppPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
appPage = require('../pages/app-page') | ||
|
||
|
||
###* | ||
Protractor e2e Tests | ||
### | ||
|
||
describe "Angular-CMS App", -> | ||
beforeEach -> | ||
appPage.refresh() | ||
it 'should have the correct title', -> | ||
appPage.title.getText().then((val)-> | ||
expect(val).toContain('angular-cms') | ||
) | ||
describe 'Angular-CMS App', -> | ||
appPage = require('../pages/app-page') | ||
it 'should have the correct title', -> | ||
appPage.title.getText().then((val)-> | ||
expect(val).toContain('angular-cms') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,11 @@ loginPage = require('../pages/login-page') | |
Login - The user login implementation | ||
### | ||
describe 'Login:', -> | ||
beforeEach -> | ||
$('[href="#/login"]').click() | ||
it 'should have Username and password inputs with a button to submit the form', -> | ||
loginPage.login('[email protected]', 'test').then(()-> | ||
expect(browser.getLocationAbsUrl()).toContain '/dashboard' | ||
) | ||
beforeEach -> | ||
loginPage.get() | ||
afterEach -> | ||
loginPage.logout() | ||
it 'should have Username and password inputs with a button to submit the form', -> | ||
loginPage.login('[email protected]', 'test').then(()-> | ||
expect(browser.getLocationAbsUrl()).toContain '/dashboard' | ||
) |