@@ -206,4 +206,114 @@ describe('Style Guide', function () {
206
206
let button = element ( by . tagName ( 'sg-app > toh-hero-button > button' ) ) ;
207
207
expect ( button . getText ( ) ) . toBe ( 'OK' ) ;
208
208
} ) ;
209
+
210
+ it ( '11-01' , function ( ) {
211
+ browser . get ( '#/11-01' ) ;
212
+
213
+ let div = element ( by . tagName ( 'sg-app div' ) ) ;
214
+ expect ( div . getText ( ) ) . toBe ( 'I am a page set to US English' ) ;
215
+ } ) ;
216
+
217
+ it ( '11-02' , function ( ) {
218
+ browser . get ( '#/11-02' ) ;
219
+
220
+ let labels = element . all ( by . tagName ( 'sg-app label' ) ) ;
221
+ expect ( labels . get ( 0 ) . getText ( ) ) . toBe ( 'Name:' ) ;
222
+ expect ( labels . get ( 1 ) . getText ( ) ) . toBe ( 'Surname:' ) ;
223
+ let inputs = element . all ( by . tagName ( 'sg-app label input' ) ) ;
224
+ expect ( inputs . get ( 0 ) . isPresent ( ) ) . toBe ( true ) ;
225
+ expect ( inputs . get ( 1 ) . isPresent ( ) ) . toBe ( true ) ;
226
+ } ) ;
227
+
228
+ it ( '11-03' , function ( ) {
229
+ browser . get ( '#/11-03' ) ;
230
+
231
+ let button = element ( by . tagName ( 'sg-app button' ) ) ;
232
+ expect ( button . getText ( ) ) . toBe ( 'Press me' ) ;
233
+ } ) ;
234
+
235
+ it ( '11-05' , function ( ) {
236
+ browser . get ( '#/11-05' ) ;
237
+
238
+ let dts = element . all ( by . tagName ( 'sg-app dt' ) ) ;
239
+ expect ( dts . get ( 0 ) . getText ( ) ) . toBe ( 'Name:' ) ;
240
+ expect ( dts . get ( 1 ) . getText ( ) ) . toBe ( 'Power:' ) ;
241
+ let dds = element . all ( by . tagName ( 'sg-app dd' ) ) ;
242
+ expect ( dds . get ( 0 ) . getText ( ) ) . toBe ( 'Windstorm' ) ;
243
+ expect ( dds . get ( 1 ) . getText ( ) ) . toBe ( 'Air' ) ;
244
+ } ) ;
245
+
246
+ it ( '11-06' , function ( ) {
247
+ browser . get ( '#/11-06' ) ;
248
+
249
+ let labels = element . all ( by . tagName ( 'sg-app label' ) ) ;
250
+ expect ( labels . get ( 0 ) . getText ( ) ) . toBe ( 'Name:' ) ;
251
+ expect ( labels . get ( 1 ) . getText ( ) ) . toBe ( 'Air' ) ;
252
+ expect ( labels . get ( 2 ) . getText ( ) ) . toBe ( 'Fire' ) ;
253
+ expect ( labels . get ( 3 ) . getText ( ) ) . toBe ( 'Name:' ) ;
254
+ expect ( labels . get ( 4 ) . getText ( ) ) . toBe ( 'Air' ) ;
255
+ expect ( labels . get ( 5 ) . getText ( ) ) . toBe ( 'Fire' ) ;
256
+ let legends = element . all ( by . tagName ( 'fieldset legend' ) ) ;
257
+ expect ( legends . get ( 0 ) . getText ( ) ) . toBe ( 'Power options' ) ;
258
+ expect ( legends . get ( 1 ) . getText ( ) ) . toBe ( 'Power options' ) ;
259
+ let inputs = element . all ( by . css ( 'sg-app input:not([type="radio"])' ) ) ;
260
+ expect ( inputs . get ( 0 ) . isPresent ( ) ) . toBe ( true ) ;
261
+ expect ( inputs . get ( 1 ) . isPresent ( ) ) . toBe ( true ) ;
262
+ let radios = element . all ( by . css ( 'sg-app input[type="radio"]' ) ) ;
263
+ expect ( radios . get ( 0 ) . isPresent ( ) ) . toBe ( true ) ;
264
+ expect ( radios . get ( 1 ) . isPresent ( ) ) . toBe ( true ) ;
265
+ expect ( radios . get ( 2 ) . isPresent ( ) ) . toBe ( true ) ;
266
+ expect ( radios . get ( 3 ) . isPresent ( ) ) . toBe ( true ) ;
267
+ } ) ;
268
+
269
+ it ( '11-07' , function ( ) {
270
+ browser . get ( '#/11-07' ) ;
271
+
272
+ let button = element ( by . tagName ( 'sg-app button' ) ) ;
273
+ expect ( button . getText ( ) ) . toBe ( 'Alert User' ) ;
274
+ let anchor = element ( by . tagName ( 'sg-app a' ) ) ;
275
+ expect ( anchor . getText ( ) ) . toBe ( 'Go to Angular!' ) ;
276
+ } ) ;
277
+
278
+ it ( '11-08' , function ( ) {
279
+ browser . get ( '#/11-08' ) ;
280
+
281
+ let ths = element . all ( by . tagName ( 'sg-app th' ) ) ;
282
+ expect ( ths . get ( 0 ) . getText ( ) ) . toBe ( 'Hero Id' ) ;
283
+ expect ( ths . get ( 1 ) . getText ( ) ) . toBe ( 'Hero Name' ) ;
284
+ expect ( ths . get ( 2 ) . getText ( ) ) . toBe ( 'Delete Hero' ) ;
285
+ let trs = element . all ( by . tagName ( 'sg-app tr' ) ) ;
286
+ let row1Tds = trs . get ( 0 ) . all ( by . tagName ( 'td' ) ) ;
287
+ expect ( row1Tds . get ( 0 ) . getText ( ) ) . toBe ( '1' ) ;
288
+ expect ( row1Tds . get ( 1 ) . getText ( ) ) . toBe ( 'Windstorm' ) ;
289
+ let row2Tds = trs . get ( 1 ) . all ( by . tagName ( 'td' ) ) ;
290
+ expect ( row2Tds . get ( 0 ) . getText ( ) ) . toBe ( '2' ) ;
291
+ expect ( row2Tds . get ( 1 ) . getText ( ) ) . toBe ( 'Bombasto' ) ;
292
+ let row3Tds = trs . get ( 2 ) . all ( by . tagName ( 'td' ) ) ;
293
+ expect ( row3Tds . get ( 0 ) . getText ( ) ) . toBe ( '3' ) ;
294
+ expect ( row3Tds . get ( 1 ) . getText ( ) ) . toBe ( 'Magneta' ) ;
295
+ let row4Tds = trs . get ( 3 ) . all ( by . tagName ( 'td' ) ) ;
296
+ expect ( row4Tds . get ( 0 ) . getText ( ) ) . toBe ( '4' ) ;
297
+ expect ( row4Tds . get ( 1 ) . getText ( ) ) . toBe ( 'Tornado' ) ;
298
+ let buttons = element . all ( by . tagName ( 'sg-app td button' ) ) ;
299
+ expect ( buttons . get ( 0 ) . getText ( ) ) . toBe ( 'Delete Windstorm' ) ;
300
+ expect ( buttons . get ( 1 ) . getText ( ) ) . toBe ( 'Delete Bombasto' ) ;
301
+ expect ( buttons . get ( 2 ) . getText ( ) ) . toBe ( 'Delete Magneta' ) ;
302
+ expect ( buttons . get ( 3 ) . getText ( ) ) . toBe ( 'Delete Tornado' ) ;
303
+ } ) ;
304
+
305
+ it ( '11-09' , function ( ) {
306
+ browser . get ( '#/11-09' ) ;
307
+
308
+ let image = element ( by . tagName ( 'sg-app img' ) ) ;
309
+ expect ( image . getAttribute ( 'alt' ) ) . toBe ( 'Angular 2 logo' ) ;
310
+ } ) ;
311
+
312
+ it ( '11-11' , function ( ) {
313
+ browser . get ( '#/11-11' ) ;
314
+
315
+ let span = element ( by . css ( 'sg-app span.green-background' ) ) ;
316
+ expect ( span . getText ( ) ) . toBe ( 'Current status is OK!' ) ;
317
+ } ) ;
318
+
209
319
} ) ;
0 commit comments