Commit 67d63df2 authored by Evren Kutar's avatar Evren Kutar

sample protractor tests and config

parent 2dd72a40
exports.config = { exports.config = {
allScriptsTimeout: 11000, allScriptsTimeout: 11000,
specs: [ specs: [
'*.js' '*.js'
], ],
capabilities: { capabilities: {
'browserName': 'chrome' 'browserName': 'chrome'
}, },
baseUrl: 'http://localhost:8000/', baseUrl: 'http://localhost:8000/',
framework: 'jasmine', framework: 'jasmine',
jasmineNodeOpts: { jasmineNodeOpts: {
defaultTimeoutInterval: 30000 defaultTimeoutInterval: 30000
} }
}; };
...@@ -2,41 +2,41 @@ ...@@ -2,41 +2,41 @@
/* https://github.com/angular/protractor/blob/master/docs/toc.md */ /* https://github.com/angular/protractor/blob/master/docs/toc.md */
describe('my app', function() { describe('my app', function () {
browser.get('index.html'); browser.get('index.html');
it('should automatically redirect to /dashboard when location hash/fragment is empty', function() { it('should automatically redirect to /dashboard when location hash/fragment is empty', function () {
expect(browser.getLocationAbsUrl()).toMatch("/login"); expect(browser.getLocationAbsUrl()).toMatch("/login");
}); });
describe('dashboard', function() { describe('dashboard', function () {
beforeEach(function () {
browser.get('index.html#/dashboard');
});
beforeEach(function() {
browser.get('index.html#/dashboard');
});
it('should redirect to login page if not logged in', function () {
expect(element.all(by.css('[ng-view] h1')).first().getText()).
toMatch(/Zaerp Login Form/);
});
it('should redirect to login page if not logged in', function() {
expect(element.all(by.css('[ng-view] h1')).first().getText()).
toMatch(/Zaerp Login Form/);
}); });
});
describe('login', function () {
describe('login', function() { beforeEach(function () {
browser.get('index.html#/login');
});
beforeEach(function() {
browser.get('index.html#/login');
});
it('should render view2 when user navigates to /view2', function () {
expect(element.all(by.css('[ng-view] h1')).first().getText()).
toMatch(/Zaerp Login Form/);
});
it('should render view2 when user navigates to /view2', function() {
expect(element.all(by.css('[ng-view] h1')).first().getText()).
toMatch(/Zaerp Login Form/);
}); });
});
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment