This repository was archived by the owner on Dec 4, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 862
Expand file tree
/
Copy pathe2e-spec.ts
More file actions
43 lines (33 loc) · 1.3 KB
/
e2e-spec.ts
File metadata and controls
43 lines (33 loc) · 1.3 KB
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
37
38
39
40
41
42
43
/// <reference path='../_protractor/e2e.d.ts' />
'use strict';
// FIRST RUN: gulp run-e2e-tests --filter=cb-item-template
// SUBSEQUENT RUNS: gulp run-e2e-tests --filter=cb-item-template --fast
describe('Item template renderer', function () {
beforeAll(function () {
browser.get('');
});
it('should toggle the menu', function () {
expect(element(by.className('select-items')).isPresent()).toBe(false);
element(by.className('select-root')).click();
expect(element(by.className('select-items')).isPresent()).toBe(true);
element(by.className('select-root')).click();
expect(element(by.className('select-items')).isPresent()).toBe(false);
});
it('should select last item', function () {
// Make sure all menu roots start out with Black.
element.all(by.className('select-root')).each(
function iterator(element) {
expect(element.getText()).toContain('Black');
}
);
// Select Magenta.
element(by.className('select-root')).click();
element.all(by.css('ul.select-items li')).last().click();
// Make sure all menu roots reflect selection (since they are sharing same model).
element.all(by.className('select-root')).each(
function iterator(element) {
expect(element.getText()).toContain('Magenta');
}
);
});
});