From 4b7398eeca939465a16f66f1ca24f5e7246f7cec Mon Sep 17 00:00:00 2001 From: Caitlin Potter Date: Tue, 19 Aug 2014 16:11:42 -0400 Subject: [PATCH] chore(protractor): enable testing ng-app-included examples /cc @petebacondarwin / @juliemr please review :> Blocks #8673 Closes #8677 --- docs/config/processors/protractor-generate.js | 3 ++- docs/config/templates/protractorTests.template.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 $} });