mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
Init e2e testing
This commit is contained in:
parent
77d1e87fdb
commit
e16ce4b4f1
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -371,4 +371,8 @@ angular.module('docs',
|
||||
$rootScope.ngProgress.start();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
if (location.search.indexOf("protractor") > -1) {
|
||||
window.name = 'NG_DEFER_BOOTSTRAP!';
|
||||
}
|
21
docs-web/src/main/webapp/test/conf.js
Normal file
21
docs-web/src/main/webapp/test/conf.js
Normal 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
|
||||
}
|
||||
};
|
24
docs-web/src/main/webapp/test/specs/temp.js
Normal file
24
docs-web/src/main/webapp/test/specs/temp.js
Normal 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();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user