Skip to content

Commit ad275b2

Browse files
juliemrIgorMinar
authored andcommitted
refactor(doc): separate end to end tests into jquery and jqlite files
1 parent 600e621 commit ad275b2

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

docs/src/gen-docs.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ writer.makeDir('build/docs/', true).then(function() {
5757
fileFutures.push(writer.output('partials/' + doc.section + '/' + id + '.html', doc.html()));
5858
// If it has a sample Protractor test, output that as well.
5959
if (doc.protractorTests.length) {
60-
fileFutures.push(writer.output('ptore2e/' + doc.section + '/' + id + '_test.js', ngdoc.writeProtractorTest(doc)));
60+
fileFutures.push(writer.output('ptore2e/' + doc.section + '/' + id + '.jquery_test.js',
61+
ngdoc.writeProtractorTest(doc, 'index-jq-nocache.html#!/')));
62+
fileFutures.push(writer.output('ptore2e/' + doc.section + '/' + id + '.jqlite_test.js',
63+
ngdoc.writeProtractorTest(doc, 'index-nocache.html#!/')));
6164
}
6265
});
6366

docs/src/ngdoc.js

+5-16
Original file line numberDiff line numberDiff line change
@@ -1110,28 +1110,17 @@ function scenarios(docs){
11101110
}
11111111
}
11121112

1113-
function writeProtractorTest(doc){
1113+
function writeProtractorTest(doc, pathPrefix){
11141114
var lines = [];
11151115
lines.push('describe("' + doc.section + '/' + doc.id + '", function() {');
1116-
lines.push(' describe("angular+jqLite", function() {')
1117-
lines.push(' beforeEach(function() {');
1118-
lines.push(' browser.get("index-nocache.html#!/' + doc.section + '/' + doc.id + '");');
1119-
lines.push(' });');
1120-
lines.push('');
1121-
doc.protractorTests.forEach(function(test){
1122-
lines.push(indentCode(trim(test), 4));
1123-
lines.push('');
1124-
});
1116+
lines.push(' beforeEach(function() {');
1117+
lines.push(' browser.get("' + pathPrefix + doc.section + '/' + doc.id + '");');
11251118
lines.push(' });');
1126-
lines.push(' describe("angular+jQuery", function() {')
1127-
lines.push(' beforeEach(function() {');
1128-
lines.push(' browser.get("index-jq-nocache.html#!/' + doc.section + '/' + doc.id + '");');
1129-
lines.push(' });');
1119+
lines.push('');
11301120
doc.protractorTests.forEach(function(test){
1131-
lines.push(indentCode(trim(test), 4));
1121+
lines.push(indentCode(trim(test), 0));
11321122
lines.push('');
11331123
});
1134-
lines.push(' });');
11351124
lines.push('});');
11361125
lines.push('');
11371126
return lines.join('\n');

0 commit comments

Comments
 (0)