-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
90 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* global browser */ | ||
exports.config = { | ||
allScriptsTimeout: 20000, | ||
specs: [ | ||
// E2E test specs are organized by user stories, not necessarily | ||
// reflecting the code structure of the project. Imagine things your | ||
// users might do, and write e2e tests around those behaviors. | ||
'test/e2e/**/*.spec.js', | ||
], | ||
capabilities: { | ||
// You can use other browsers | ||
// like firefox, phantoms, safari, IE, etc. | ||
'browserName': 'chrome' | ||
}, | ||
|
||
baseUrl: 'http://localhost:8100', | ||
|
||
framework: 'jasmine', | ||
|
||
jasmineNodeOpts: { | ||
showColors: true, | ||
defaultTimeoutInterval: 30000, | ||
isVerbose: true, | ||
} | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Test the login experience | ||
describe('Login', function(){ | ||
|
||
beforeEach(function() { | ||
// before each spec, load the login page | ||
browser.get('/#/login'); | ||
}); | ||
|
||
it('should fail with an appropriate error message when password is invalid', function() { | ||
// Enter an invalid password and try to log in | ||
element(by.name('email')).sendKeys('someone@example.com'); | ||
element(by.name('password')).sendKeys('badpassword'); | ||
element(by.name('login')).click(); | ||
|
||
// We should see an error message about the invalid password | ||
var errorDisplay = element(by.css(".form-error")); | ||
expect(errorDisplay.getText()).toContain('Invalid'); | ||
}); | ||
|
||
it('should log in and go to home when a valid password is entered', function() { | ||
// Enter a valid password, and try to log in | ||
element(by.name('email')).sendKeys('someone@example.com'); | ||
element(by.name('password')).sendKeys('password'); | ||
element(by.name('login')).click(); | ||
|
||
// We should navigate to the app (home or intro if it is first use) | ||
// on successful sign-in | ||
expect(browser.getLocationAbsUrl()).toContain('/app/'); | ||
|
||
// Test logout experience | ||
describe('Logout', function() { | ||
|
||
it('should be able to log out after a successful login', function() { | ||
// Click the logout button | ||
element(by.name('logout')).click(); | ||
|
||
// We should now go to the logged out screen | ||
expect(browser.getLocationAbsUrl()).toContain('/loggedout'); | ||
}); | ||
}); | ||
}); | ||
}); |