diff --git a/docs/config/processors/protractor-generate.js b/docs/config/processors/protractor-generate.js index 13de96c0505a..a925f46a8ce7 100644 --- a/docs/config/processors/protractor-generate.js +++ b/docs/config/processors/protractor-generate.js @@ -33,7 +33,8 @@ module.exports = { innerTest: file.fileContents, pathPrefix: '.', // Hold for if we test with full jQuery exampleId: example.id, - description: example.doc.id + description: example.doc.id, + 'ng-app-included': example['ng-app-included'] }; if (env === 'jquery') { diff --git a/docs/config/templates/protractorTests.template.js b/docs/config/templates/protractorTests.template.js index 1801486501a2..d26c2703c9ef 100644 --- a/docs/config/templates/protractorTests.template.js +++ b/docs/config/templates/protractorTests.template.js @@ -1,7 +1,10 @@ describe("{$ doc.description $}", function() { + var rootEl; beforeEach(function() { + rootEl = browser.rootEl;{% if doc['ng-app-included'] %} + browser.rootEl = '[ng-app]';{% endif %} browser.get("{$ doc.pathPrefix $}/{$ doc.examplePath $}"); }); - + {% if doc['ng-app-included'] %}afterEach(function() { browser.rootEl = rootEl; });{% endif %} {$ doc.innerTest $} });