Init e2e testing

This commit is contained in:
jendib 2016-04-13 01:30:02 +02:00
parent 77d1e87fdb
commit e16ce4b4f1
4 changed files with 53 additions and 2 deletions

View File

@ -19,6 +19,8 @@
"grunt-contrib-less": "~0.9.0",
"grunt-remove": "~0.1.0",
"grunt-ngmin": "0.0.3",
"grunt-text-replace": "~0.3.11"
"grunt-text-replace": "~0.3.11",
"protractor": "~3.2.2",
"selenium": "~2.20.0"
}
}

View File

@ -371,4 +371,8 @@ angular.module('docs',
$rootScope.ngProgress.start();
}
});
});
});
if (location.search.indexOf("protractor") > -1) {
window.name = 'NG_DEFER_BOOTSTRAP!';
}

View File

@ -0,0 +1,21 @@
'use strict';
exports.config = {
seleniumServerJar: '../node_modules/selenium/lib/runner/selenium-server-standalone-2.20.0.jar',
framework: 'jasmine',
rootElement: 'html',
baseUrl: 'http://localhost:9999/docs-web/src/?protractor',
capabilities: {
'browserName': 'chrome'
},
specs: [
'specs/**/*.js'
],
jasmineNodeOpts: {
isVerbose: true,
showColors: true,
defaultTimeoutInterval: 30000
}
};

View File

@ -0,0 +1,24 @@
'use strict';
describe('document', function () {
it('should create and delete a document', function () {
browser.get('');
// Login as admin
element(by.model('user.username')).sendKeys('admin');
element(by.model('user.password')).sendKeys('admin');
element(by.css('.login-box button[type="submit"]')).click();
// Create a document
element(by.partialLinkText('Add a document')).click();
element(by.model('document.title')).sendKeys('My test document');
element(by.buttonText('Add')).click();
// Open the last document
element(by.css('.table-documents tbody tr:nth-child(1)')).click();
// Delete the document
element(by.partialButtonText('Delete')).click();
element(by.partialButtonText('OK')).click();
});
});