forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery_test.js
34 lines (26 loc) · 1.23 KB
/
jquery_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
describe("module:ng.directive:ngController", function() {
beforeEach(function() {
browser.get("./examples/example-example20/index-jquery.html");
});
it('should check controller as', function() {
var container = element(by.id('ctrl-as-exmpl'));
expect(container.findElement(by.model('settings.name'))
.getAttribute('value')).toBe('John Smith');
var firstRepeat =
container.findElement(by.repeater('contact in settings.contacts').row(0));
var secondRepeat =
container.findElement(by.repeater('contact in settings.contacts').row(1));
expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
.toBe('408 555 1212');
expect(secondRepeat.findElement(by.model('contact.value')).getAttribute('value'))
.toBe('[email protected]');
firstRepeat.findElement(by.linkText('clear')).click();
expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
.toBe('');
container.findElement(by.linkText('add')).click();
expect(container.findElement(by.repeater('contact in settings.contacts').row(2))
.findElement(by.model('contact.value'))
.getAttribute('value'))
.toBe('[email protected]');
});
});