forked from angular/angular.io
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathe2e-spec.ts
182 lines (120 loc) · 4.32 KB
/
e2e-spec.ts
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
'use strict'; // necessary for es6 output in node
import { browser, element, by } from 'protractor';
import { setProtractorToHybridMode } from '../protractor-helpers';
describe('Upgrade Tests', function () {
beforeAll(function () {
setProtractorToHybridMode();
});
describe('AngularJS Auto-bootstrap', function() {
beforeAll(function () {
browser.get('/index-ng-app.html');
});
it('bootstraps as expected', function () {
expect(element(by.css('#message')).getText()).toEqual('Hello world');
});
});
describe('AngularJS JavaScript Bootstrap', function() {
beforeAll(function () {
browser.get('/index-bootstrap.html');
});
it('bootstraps as expected', function () {
expect(element(by.css('#message')).getText()).toEqual('Hello world');
});
});
describe('AngularJS-Angular Hybrid Bootstrap', function() {
beforeAll(function () {
browser.get('/index-ajs-a-hybrid-bootstrap.html');
});
it('bootstraps as expected', function () {
expect(element(by.css('#message')).getText()).toEqual('Hello world');
});
});
describe('Upgraded static component', function() {
beforeAll(function () {
browser.get('/index-upgrade-static.html');
});
it('renders', function () {
expect(element(by.css('h2')).getText()).toEqual('Windstorm details!');
});
});
describe('Upgraded component with IO', function() {
beforeAll(function () {
browser.get('/index-upgrade-io.html');
});
it('has inputs', function () {
expect(element(by.css('h2')).getText()).toEqual('Windstorm details!');
});
it('has outputs', function () {
element(by.buttonText('Delete')).click();
expect(element(by.css('h2')).getText()).toEqual('Ex-Windstorm details!');
});
});
describe('Downgraded static component', function() {
beforeAll(function () {
browser.get('/index-downgrade-static.html');
});
it('renders', function () {
expect(element(by.css('h2')).getText()).toEqual('Windstorm details!');
});
});
describe('Downgraded component with IO', function() {
beforeAll(function () {
browser.get('/index-downgrade-io.html');
});
it('has inputs', function () {
expect(element.all(by.css('h2')).first().getText()).toEqual('Windstorm details!');
});
it('has outputs', function () {
element.all(by.buttonText('Delete')).first().click();
expect(element.all(by.css('h2')).first().getText()).toEqual('Ex-Windstorm details!');
});
it('supports ng-repeat', function () {
expect(element.all(by.css('hero-detail')).count()).toBe(3);
});
});
describe('Downgraded component with content projection', function() {
beforeAll(function () {
browser.get('/index-ajs-to-a-projection.html');
});
it('can be transcluded into', function () {
expect(element(by.css('hero-detail')).getText()).toContain('Specific powers of controlling winds');
});
});
describe('Upgraded component with transclusion', function() {
beforeAll(function () {
browser.get('/index-a-to-ajs-transclusion.html');
});
it('can be projected into', function () {
expect(element(by.css('hero-detail')).getText()).toContain('Specific powers of controlling winds');
});
});
describe('Upgrading AngularJS Providers', function() {
beforeAll(function () {
browser.get('/index-ajs-to-a-providers.html');
});
it('works', function () {
expect(element(by.css('h2')).getText()).toBe('1: Windstorm');
});
});
describe('Downgrading Angular Providers', function() {
beforeAll(function () {
browser.get('/index-a-to-ajs-providers.html');
});
it('works', function () {
expect(element(by.css('h2')).getText()).toBe('1: Windstorm');
});
});
describe('Dividing routes', function() {
beforeAll(function () {
browser.get('/index-divide-routes.html');
});
it('allows ng1 routes', function () {
browser.get('/index-divide-routes.html#/villain');
expect(element(by.css('h2')).getText()).toBe('Mr. Nice - No More Mr. Nice Guy');
});
it('allows ng2 routes', function () {
browser.get('/index-divide-routes.html#/hero');
expect(element(by.css('h2')).getText()).toBe('Windstorm - Specific powers of controlling winds');
});
});
});