diff options
| author | Julie | 2014-01-06 15:13:57 -0800 |
|---|---|---|
| committer | Julie | 2014-01-08 13:07:58 -0800 |
| commit | b6c42d5e8155edc9013bd531f553c278ce37c3c8 (patch) | |
| tree | 225bbc1e0522b42b2cdd9bccfe36452ad88ad3d4 /docs/src/example.js | |
| parent | 1c045f1b463cf8c2d0c470fc6e44170997e85d89 (diff) | |
| download | angular.js-b6c42d5e8155edc9013bd531f553c278ce37c3c8.tar.bz2 | |
feat(docs): adding the <doc:protractor> ngdoc-tag
This is the first step in migrating tests from <doc:scenario> to <doc:protractor>.
In-documentation examples with doc:protractor sections will have their contents
output to a tab on the docs site as well as output to a standalone test file in
build/docs/ptore2e.
Diffstat (limited to 'docs/src/example.js')
| -rw-r--r-- | docs/src/example.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/docs/src/example.js b/docs/src/example.js index 9471b3fa..7a32ce04 100644 --- a/docs/src/example.js +++ b/docs/src/example.js @@ -6,7 +6,8 @@ var makeUnique = { 'script.js': true, 'unit.js': true, 'spec.js': true, - 'scenario.js': true + 'scenario.js': true, + 'protractorTest.js': true } function ids(list) { @@ -14,7 +15,7 @@ function ids(list) { }; -exports.Example = function(scenarios) { +exports.Example = function(scenarios, protractorTests) { this.module = ''; this.deps = ['angular.js']; this.html = []; @@ -24,6 +25,8 @@ exports.Example = function(scenarios) { this.unit = []; this.scenario = []; this.scenarios = scenarios; + this.protractorTest = []; + this.protractorTests = protractorTests; } exports.Example.prototype.setModule = function(module) { @@ -44,6 +47,10 @@ exports.Example.prototype.addSource = function(name, content) { var ext = name == 'scenario.js' ? 'scenario' : name.split('.')[1], id = name; + if (name == 'protractorTest.js') { + ext = 'protractorTest'; + } + if (makeUnique[name] && usedIds[id]) { id = name + '-' + (seqCount++); } @@ -56,6 +63,9 @@ exports.Example.prototype.addSource = function(name, content) { if (ext == 'scenario') { this.scenarios.push(content); } + if (ext == 'protractorTest') { + this.protractorTests.push(content); + } }; exports.Example.prototype.enableAnimations = function() { @@ -92,6 +102,7 @@ exports.Example.prototype.toHtmlEdit = function() { out.push(' source-edit-json="' + ids(this.json) + '"'); out.push(' source-edit-unit="' + ids(this.unit) + '"'); out.push(' source-edit-scenario="' + ids(this.scenario) + '"'); + out.push(' source-edit-protractor="' + ids(this.protractorTest) + '"'); out.push('></div>\n'); return out.join(''); }; @@ -107,6 +118,7 @@ exports.Example.prototype.toHtmlTabs = function() { htmlTabs(this.json); htmlTabs(this.unit); htmlTabs(this.scenario); + htmlTabs(this.protractorTest); out.push('</div>'); return out.join(''); @@ -119,7 +131,8 @@ exports.Example.prototype.toHtmlTabs = function() { if (name === 'index.html') { wrap = ' ng-html-wrap="' + self.module + ' ' + self.deps.join(' ') + '"'; } - if (name == 'scenario.js') name = 'End to end test'; + if (name == 'scenario.js') name = 'ngScenario e2e test'; + if (name == 'protractorTest.js') name = 'Protractor e2e test'; out.push( '<div class="tab-pane" title="' + name + '">\n' + |
