Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
chore(protractor): enable testing ng-app-included examples
Browse files Browse the repository at this point in the history
/cc @petebacondarwin / @juliemr please review :>

Blocks #8673
Closes #8677
  • Loading branch information
caitp committed Aug 21, 2014
1 parent 4e79dec commit 4b7398e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/config/processors/protractor-generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
5 changes: 4 additions & 1 deletion docs/config/templates/protractorTests.template.js
Original file line number Diff line number Diff line change
@@ -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 $}
});

0 comments on commit 4b7398e

Please sign in to comment.