mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-05-15 17:18:09 +08:00
refactor(doc): separate end to end tests into jquery and jqlite files
This commit is contained in:
@@ -57,7 +57,10 @@ writer.makeDir('build/docs/', true).then(function() {
|
||||
fileFutures.push(writer.output('partials/' + doc.section + '/' + id + '.html', doc.html()));
|
||||
// If it has a sample Protractor test, output that as well.
|
||||
if (doc.protractorTests.length) {
|
||||
fileFutures.push(writer.output('ptore2e/' + doc.section + '/' + id + '_test.js', ngdoc.writeProtractorTest(doc)));
|
||||
fileFutures.push(writer.output('ptore2e/' + doc.section + '/' + id + '.jquery_test.js',
|
||||
ngdoc.writeProtractorTest(doc, 'index-jq-nocache.html#!/')));
|
||||
fileFutures.push(writer.output('ptore2e/' + doc.section + '/' + id + '.jqlite_test.js',
|
||||
ngdoc.writeProtractorTest(doc, 'index-nocache.html#!/')));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1110,28 +1110,17 @@ function scenarios(docs){
|
||||
}
|
||||
}
|
||||
|
||||
function writeProtractorTest(doc){
|
||||
function writeProtractorTest(doc, pathPrefix){
|
||||
var lines = [];
|
||||
lines.push('describe("' + doc.section + '/' + doc.id + '", function() {');
|
||||
lines.push(' describe("angular+jqLite", function() {')
|
||||
lines.push(' beforeEach(function() {');
|
||||
lines.push(' browser.get("index-nocache.html#!/' + doc.section + '/' + doc.id + '");');
|
||||
lines.push(' });');
|
||||
lines.push(' beforeEach(function() {');
|
||||
lines.push(' browser.get("' + pathPrefix + doc.section + '/' + doc.id + '");');
|
||||
lines.push(' });');
|
||||
lines.push('');
|
||||
doc.protractorTests.forEach(function(test){
|
||||
lines.push(indentCode(trim(test), 4));
|
||||
lines.push(indentCode(trim(test), 0));
|
||||
lines.push('');
|
||||
});
|
||||
lines.push(' });');
|
||||
lines.push(' describe("angular+jQuery", function() {')
|
||||
lines.push(' beforeEach(function() {');
|
||||
lines.push(' browser.get("index-jq-nocache.html#!/' + doc.section + '/' + doc.id + '");');
|
||||
lines.push(' });');
|
||||
doc.protractorTests.forEach(function(test){
|
||||
lines.push(indentCode(trim(test), 4));
|
||||
lines.push('');
|
||||
});
|
||||
lines.push(' });');
|
||||
lines.push('});');
|
||||
lines.push('');
|
||||
return lines.join('\n');
|
||||
|
||||
Reference in New Issue
Block a user