forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault_test.js
36 lines (28 loc) · 1.16 KB
/
default_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
35
36
describe("", function() {
var rootEl;
beforeEach(function() {
rootEl = browser.rootEl;
browser.get("examples/example-ngController/index.html");
});
it('should check controller', function() {
var container = element(by.id('ctrl-exmpl'));
expect(container.element(by.model('name'))
.getAttribute('value')).toBe('John Smith');
var firstRepeat =
container.element(by.repeater('contact in contacts').row(0));
var secondRepeat =
container.element(by.repeater('contact in contacts').row(1));
expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
.toBe('408 555 1212');
expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
.toBe('[email protected]');
firstRepeat.element(by.linkText('clear')).click();
expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
.toBe('');
container.element(by.linkText('add')).click();
expect(container.element(by.repeater('contact in contacts').row(2))
.element(by.model('contact.value'))
.getAttribute('value'))
.toBe('[email protected]');
});
});