-
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
c620d9c
commit 64f533b
Showing
14 changed files
with
84 additions
and
90 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
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
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 |
---|---|---|
|
@@ -41,8 +41,8 @@ var MESSAGES = { | |
}; | ||
var DS = require('jps-ds').DS; | ||
var _ds = new DS({ | ||
host: 'angularcms:[email protected]:10089/app19632340', | ||
//host: 'localhost/angular-cms', | ||
//host: 'angularcms:[email protected]:10089/app19632340', | ||
host: 'localhost/angular-cms', | ||
models: { | ||
'groups': { | ||
title: String, | ||
|
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,10 +1,14 @@ | ||
###* | ||
Login Page - I handle actions on the login page. | ||
### | ||
module.exports = LoginPage = () -> | ||
@get = -> | ||
browser.get '/#/login' | ||
@login = (u, p) -> | ||
j$.input('username').sendKeys(u) | ||
j$.input('password').sendKeys(p) | ||
j$.element('button[type="submit"]').click() | ||
LoginPage = | ||
username: $('#username') | ||
password: $('#password') | ||
get: -> | ||
browser.get '/login' | ||
login: (u, p) -> | ||
@username.sendKeys(u) | ||
@password.sendKeys(p) | ||
element(protractor.By.css('button[type="submit"]')).click() | ||
|
||
module.exports = LoginPage |
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,18 +1,23 @@ | ||
j$ = require('../j$') | ||
|
||
###* | ||
Register Page - I handle actions on the register page | ||
### | ||
module.exports = RegisterPage = () -> | ||
email = j$.input('email') | ||
username = j$.input('username') | ||
password = j$.input('password') | ||
password2 = j$.input('password2') | ||
agree = j$.input('agree') | ||
@get = -> | ||
browser.get '/#/register' | ||
@register = -> | ||
email.sendKeys('[email protected]') | ||
username.sendKeys('test') | ||
password.sendKeys('test') | ||
password2.sendKeys('test') | ||
agree.click() | ||
element(protractor.By.css('button[type="submit"]')).click() | ||
RegisterPage = | ||
email = $('#email') | ||
username: $('#username') | ||
password: $('#password') | ||
password2: $('#password2') | ||
agree: $('#agree') | ||
submit: element(protractor.By.css('button')) | ||
get: -> | ||
browser.get '/register' | ||
register: (username, password) -> | ||
@email.sendKeys(username) | ||
@username.sendKeys(username) | ||
@password.sendKeys(password) | ||
@password2.sendKeys(password) | ||
@agree.click() | ||
@submit.click() | ||
|
||
module.exports = RegisterPage |
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,15 +1,14 @@ | ||
AppPage = require('../pages/app-page') | ||
appPage = require('../pages/app-page') | ||
|
||
|
||
###* | ||
Protractor e2e Tests | ||
### | ||
App = new AppPage() | ||
|
||
describe "Angular-CMS App", -> | ||
beforeEach -> | ||
App.get() | ||
|
||
#Welome Story: the initial page | ||
describe 'Index:', -> | ||
it "should display the main index view as default", -> | ||
expect(browser.getLocationAbsUrl()).toEqual '/' | ||
appPage.refresh() | ||
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 |
---|---|---|
@@ -1,24 +1,12 @@ | ||
LoginPage = require('../pages/login-page') | ||
loginPage = new LoginPage() | ||
loginPage = require('../pages/login-page') | ||
|
||
###* | ||
Login - The user login implementation | ||
### | ||
describe 'Login:', -> | ||
|
||
#Click the login button each time | ||
beforeEach -> | ||
$('a[href="#/login"]').click() | ||
|
||
#Make sure we end up at the login page to enter our credentials | ||
#Make sure there is a username and password input with button | ||
$('[href="#/login"]').click() | ||
it 'should have Username and password inputs with a button to submit the form', -> | ||
expect(browser.getLocationAbsUrl()).toEqual '/login' | ||
|
||
#Login to the page | ||
loginPage.login('[email protected]', 'test') | ||
|
||
#Wait for the api call to go thru | ||
sleep 1 | ||
|
||
#We should end up at the dashboard page. | ||
expect(browser.getLocationAbsUrl()).toEqual '/dashboard' | ||
loginPage.login('[email protected]', 'test').then(()-> | ||
expect(browser.getLocationAbsUrl()).toContain '/dashboard' | ||
) |
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,16 +1,13 @@ | ||
RegisterPage = require('../pages/register-page') | ||
j$ = require('../j$') | ||
registerPage = require('../pages/register-page') | ||
|
||
###* | ||
Register - The user registration implementation | ||
### | ||
testEmail = Date.now() + '[email protected]' | ||
describe 'Register: ', -> | ||
it 'should have email and password inputs with a button to submit the form', -> | ||
registerPage = new RegisterPage() | ||
it 'should allow a user to register', -> | ||
registerPage.get() | ||
expect(browser.getCurrentUrl()).toContain 'register' | ||
expect(j$.element('form', 'Login form').count()).toEqual 1 | ||
expect(j$.element('input[name="email"]', 'Email input').count()).toEqual 1 | ||
expect(j$.element('input[name="username"]', 'Username input').count()).toEqual 1 | ||
expect(j$.element('input[name="password"]', 'Password input').count()).toEqual 2 | ||
expect(j$.element('button[type="submit"]', 'Submit button').count()).toEqual 1 | ||
registerPage.register(testEmail, 'test').then(()-> | ||
expect(browser.getCurrentUrl()).toContain 'dashboard' | ||
) |