This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added nested angular app capability via conf file. Copied some tests …
…over to demonstrate Changed option name to coincide with angular's $rootElement semantics
- Loading branch information
1 parent
422eab6
commit 3c76246
Showing
7 changed files
with
116 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var util = require('util'); | ||
|
||
describe('finding elements when ng-app is nested', function() { | ||
var ptor; | ||
|
||
describe('in forms', function() { | ||
ptor = protractor.getInstance(); | ||
|
||
beforeEach(function() { | ||
ptor.get('app/alt_root_index.html#/form'); | ||
}); | ||
|
||
it('should find an element by binding', function() { | ||
var greeting = ptor.findElement(protractor.By.binding('{{greeting}}')); | ||
|
||
expect(greeting.getText()).toEqual('Hiya'); | ||
}); | ||
|
||
it('should find elements outside of angular', function() { | ||
var outside = ptor.findElement(protractor.By.id('outside-ng')); | ||
var inside = ptor.findElement(protractor.By.id('inside-ng')); | ||
|
||
expect(outside.getText()).toEqual('{{1 + 2}}'); | ||
expect(inside.getText()).toEqual('3'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Tests for an Angular app where ng-app is not on the body. | ||
exports.config = { | ||
seleniumServerJar: './selenium/selenium-server-standalone-2.35.0.jar', | ||
chromeDriver: './selenium/chromedriver', | ||
|
||
seleniumAddress: 'http://localhost:4444/wd/hub', | ||
|
||
// Spec patterns are relative to the current working directly when | ||
// protractor is called. | ||
specs: [ | ||
'spec/altRoot/*_spec.js', | ||
], | ||
|
||
capabilities: { | ||
'browserName': 'chrome' | ||
}, | ||
|
||
// Selector for the element housing the angular app. | ||
rootElement: 'div#nested-ng-app', | ||
|
||
baseUrl: 'http://localhost:8000', | ||
|
||
jasmineNodeOpts: { | ||
onComplete: null, | ||
isVerbose: false, | ||
showColors: true, | ||
includeStackTrace: true, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>My AngularJS App</title> | ||
<link rel="stylesheet" href="css/app.css"/> | ||
</head> | ||
<body> | ||
|
||
<div id="outside-ng"> | ||
{{1 + 2}} | ||
</div> | ||
|
||
<div id="nested-ng-app" ng-app="myApp"> | ||
<div id="inside-ng"> | ||
{{1 + 2}} | ||
</div> | ||
|
||
<ul class="menu"> | ||
<li><a href="#/http">http</a></li> | ||
<li><a href="#/repeater">repeater</a></li> | ||
<li><a href="#/bindings">bindings</a></li> | ||
<li><a href="#/form">form</a></li> | ||
<li><a href="#/async">async</a></li> | ||
</ul> | ||
|
||
<div ng-view></div> | ||
<div>Angular seed app: v<span app-version></span></div> | ||
</div> | ||
|
||
<!-- In production use: | ||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> | ||
--> | ||
<script src="lib/angular_v1.0.6/angular.js"></script> | ||
<script src="js/app.js"></script> | ||
<script src="js/services.js"></script> | ||
<script src="js/controllers.js"></script> | ||
<script src="js/filters.js"></script> | ||
<script src="js/directives.js"></script> | ||
</body> | ||
</html> |