-
Notifications
You must be signed in to change notification settings - Fork 5
/
ViewTest.java
606 lines (493 loc) · 25.8 KB
/
ViewTest.java
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
package org.vaadin.tatu;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.checkbox.Checkbox;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.component.html.Label;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.select.Select;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.testbench.unit.UIUnit4Test;
public class ViewTest extends UIUnit4Test {
@Test
public void sorting() {
navigate(View.class);
test($(Button.class).withCaption("Set").first()).click();
test($(Checkbox.class).withCaption("Sorting").first()).click();
List<SelectItem> options = $(SelectItem.class,
$(VerticalLayout.class).withClassName("options").first()).all();
// List is now alphabetically ordered
Assert.assertEquals("Eight", options.get(0).getLabel());
Assert.assertEquals("Five", options.get(1).getLabel());
Assert.assertEquals("Four", options.get(2).getLabel());
Assert.assertEquals("Nine", options.get(3).getLabel());
Assert.assertEquals("One", options.get(4).getLabel());
Assert.assertEquals("Seven", options.get(5).getLabel());
Assert.assertEquals("Six", options.get(6).getLabel());
Assert.assertEquals("Ten", options.get(7).getLabel());
Assert.assertEquals("Three", options.get(8).getLabel());
Assert.assertEquals("Two", options.get(9).getLabel());
// Pick items
$(SelectItem.class).withText("Two").first().click();
test($(Button.class).atIndex(2)).click();
$(SelectItem.class).withText("Four").first().click();
test($(Button.class).atIndex(2)).click();
// Selection follows the order
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals("Four,Two selected!", value);
List<SelectItem> selected = $(SelectItem.class,
$(VerticalLayout.class).withClassName("value").first())
.withValue(true).all();
Assert.assertEquals("Four", selected.get(0).getLabel());
Assert.assertEquals("Two", selected.get(1).getLabel());
}
@Test
public void paintSelected() {
navigate(View.class);
test($(Button.class).withCaption("Set").first()).click();
List<SelectItem> options = $(SelectItem.class,
$(VerticalLayout.class).withClassName("options").first())
.withValue(true).all();
Assert.assertEquals(0, options.size());
// Pick items
$(SelectItem.class).withText("Two").first().click();
$(SelectItem.class).withText("Four").first().click();
test($(Button.class).atIndex(2)).click();
List<SelectItem> selected = $(SelectItem.class,
$(VerticalLayout.class).withClassName("value").first())
.withValue(true).all();
Assert.assertEquals(2, selected.size());
test($(Button.class).atIndex(5)).click();
options = $(SelectItem.class,
$(VerticalLayout.class).withClassName("options").first())
.withValue(true).all();
Assert.assertEquals(8, options.size());
selected = $(SelectItem.class,
$(VerticalLayout.class).withClassName("value").first())
.withValue(true).all();
Assert.assertEquals(0, selected.size());
}
@Test
public void initialState() {
navigate(View.class);
Assert.assertEquals(0, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(0, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
// Assert that label has correct text
Assert.assertEquals("Select Two and Four",
test($(Label.class).withClassName("twincolselect-label-styles")
.first()).getText());
// Assert that button states are correct
Assert.assertFalse(test($(Button.class).atIndex(1)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(2)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(3)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(4)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(5)).isUsable());
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
Assert.assertEquals("Item count: 10",
test($(Notification.class).last()).getText());
// Assert that options have 10 items
Assert.assertEquals(10, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(0, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
// Assert button states
Assert.assertTrue(test($(Button.class).atIndex(1)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(2)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(3)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(4)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(5)).isUsable());
}
@Test
public void readOnlyState() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
// Put the TwinColSelect in read only state
test($(Button.class).withCaption("Read only").first()).click();
// Assert that options are inert
List<Checkbox> options = $(Checkbox.class,
$(VerticalLayout.class).withClassName("options").first()).all();
options.forEach(box -> Assert.assertFalse(test(box).isUsable()));
// Assert that buttons are inert
Assert.assertFalse(test($(Button.class).atIndex(1)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(2)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(3)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(4)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(5)).isUsable());
// Put the TwinColSelect back in normal state
test($(Button.class).withCaption("Read only").first()).click();
// Assert that options are selectable
options.forEach(box -> Assert.assertTrue(test(box).isUsable()));
// Assert that button states are correct
Assert.assertTrue(test($(Button.class).atIndex(1)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(2)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(3)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(4)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(5)).isUsable());
}
@Test
public void selectAll_deselectAll() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
Assert.assertTrue(test($(Button.class).atIndex(1)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(2)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(3)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(4)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(5)).isUsable());
test($(Button.class).atIndex(1)).click();
// Assert that span containing the value prints out right value
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals(
"One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten selected!",
value);
// Options is empty and value has 10 items
Assert.assertEquals(0, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(10, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
List<Checkbox> selected = $(Checkbox.class,
$(VerticalLayout.class).withClassName("value").first())
.withValue(true).all();
Assert.assertEquals(0, selected.size());
// Assert button states are correct
Assert.assertFalse(test($(Button.class).atIndex(1)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(2)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(3)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(4)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(5)).isUsable());
// De-select
test($(Button.class).atIndex(4)).click();
// Assert value is empty
Assert.assertEquals(10, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(0, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
// Assert button states are correct
Assert.assertTrue(test($(Button.class).atIndex(1)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(2)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(3)).isUsable());
Assert.assertFalse(test($(Button.class).atIndex(4)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(5)).isUsable());
// Assert that error text is correct as the field was requited
Div errorLabel = $(Div.class)
.withAttribute("class", "twincolselect-errorlabel").first();
Assert.assertEquals("Empty selection not allowed",
test(errorLabel).getText());
}
@Test
public void selectAll_deselectOne() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
test($(Button.class).atIndex(1)).click();
// Assert that span containing the value prints out right value
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals(
"One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten selected!",
value);
// Options is empty and value has 10 items
Assert.assertEquals(0, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(10, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
$(SelectItem.class).withText("One").first().click();
test($(Button.class).atIndex(3)).click();
// Assert value has nine items
Assert.assertEquals(1, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(9, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
value = test($(Span.class).id("value")).getText();
Assert.assertEquals(
"Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten selected!",
value);
List<SelectItem> tickedOptions = $(SelectItem.class,
$(VerticalLayout.class).withClassName("options").first())
.withValue(true).all();
Assert.assertEquals(1, tickedOptions.size());
}
@Test
public void filteringItems() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
// Set the filter to be "T"
test($(TextField.class).withCaption("Filter").first()).setValue("T");
Assert.assertEquals("Item count: 3",
test($(Notification.class).last()).getText());
List<SelectItem> filtered = $(SelectItem.class,
$(VerticalLayout.class).withClassName("options").first()).all();
// Assert that we have right values, i.e. ones startign with "T"
Assert.assertEquals("Two", filtered.get(0).getLabel());
Assert.assertEquals("Three", filtered.get(1).getLabel());
Assert.assertEquals("Ten", filtered.get(2).getLabel());
// Select all three
test($(Button.class).atIndex(1)).click();
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals("Two,Three,Ten selected!", value);
// Clear filter
test($(TextField.class).withCaption("Filter").first()).setValue("");
Assert.assertEquals("Item count: 10",
test($(Notification.class).last()).getText());
// Options has 7 and value has 3 items
Assert.assertEquals(7, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(3, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
}
@Test
public void errorLabelIsShown() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
// Pick items
$(SelectItem.class).withText("One").first().click();
$(SelectItem.class).withText("Three").first().click();
test($(Button.class).atIndex(2)).click();
// Assert the error label as the selection does not match validator
Div errorLabel = $(Div.class)
.withAttribute("class", "twincolselect-errorlabel").first();
Assert.assertEquals("Selection needs to contain two and four",
test(errorLabel).getText());
// Pick items
$(SelectItem.class).withText("Two").first().click();
$(SelectItem.class).withText("Four").first().click();
test($(Button.class).atIndex(2)).click();
// Assert that error label is not visible as validator passes
Assert.assertFalse(errorLabel.isVisible());
}
@Test
public void selectionOrderIsPreserved() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
// Pick three items one at the time
$(SelectItem.class).withText("Five").first().click();
test($(Button.class).atIndex(2)).click();
$(SelectItem.class).withText("Two").first().click();
test($(Button.class).atIndex(2)).click();
$(SelectItem.class).withText("Four").first().click();
test($(Button.class).atIndex(2)).click();
// Assert that span containing the value prints out in correct order
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals("Five,Two,Four selected!", value);
// Find the checkboxes from the target list and assert their labels are
// in assumed order
List<SelectItem> selected = $(SelectItem.class,
$(VerticalLayout.class).withClassName("value").first())
.withValue(true).all();
Assert.assertEquals("Five", selected.get(0).getLabel());
Assert.assertEquals("Two", selected.get(1).getLabel());
Assert.assertEquals("Four", selected.get(2).getLabel());
}
@Test
public void selectionOrderIsPreserved_clear_singleClick() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
test($(Select.class).first()).selectItem("SINGLE");
// Pick three items one at the time
$(SelectItem.class).withText("Five").first().click();
String value = test($(Span.class).id("value")).getText();
// Assert that span is containing the value
Assert.assertEquals("Five selected!", value);
$(SelectItem.class).withText("Two").first().click();
// Assert that span containing the value prints out in correct order
value = test($(Span.class).id("value")).getText();
Assert.assertEquals("Five,Two selected!", value);
$(SelectItem.class).withText("Four").first().click();
// Assert that span containing the value prints out in correct order
value = test($(Span.class).id("value")).getText();
Assert.assertEquals("Five,Two,Four selected!", value);
// Find the checkboxes from the target list and assert their labels are
// in assumed order
List<SelectItem> selected = $(SelectItem.class,
$(VerticalLayout.class).withClassName("value").first()).all();
Assert.assertEquals("Five", selected.get(0).getLabel());
Assert.assertEquals("Two", selected.get(1).getLabel());
Assert.assertEquals("Four", selected.get(2).getLabel());
test($(Button.class).withCaption("Clear Ticks (BOTH)").first()).click();
// Move Two back to options, and re-assert
$(SelectItem.class).withText("Two").first().click();
value = test($(Span.class).id("value")).getText();
Assert.assertEquals("Five,Four selected!", value);
selected = $(SelectItem.class,
$(VerticalLayout.class).withClassName("value").first()).all();
Assert.assertEquals("Five", selected.get(0).getLabel());
Assert.assertEquals("Four", selected.get(1).getLabel());
// Clear and assert
test($(Button.class).withCaption("Clear").first()).click();
selected = $(SelectItem.class,
$(VerticalLayout.class).withClassName("value").first()).all();
value = test($(Span.class).id("value")).getText();
Assert.assertEquals(" selected!", value);
Assert.assertEquals(0, selected.size());
}
@Test
public void clearTicks() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
// Tick items
$(SelectItem.class).withText("Two").first().click();
$(SelectItem.class).withText("Four").first().click();
List<SelectItem> ticked = $(SelectItem.class,
$(VerticalLayout.class).withClassName("options").first())
.withValue(true).all();
Assert.assertEquals(2, ticked.size());
test($(Button.class).withCaption("Clear Ticks (BOTH)").first()).click();
ticked = $(SelectItem.class,
$(VerticalLayout.class).withClassName("options").first())
.withValue(true).all();
Assert.assertEquals(0, ticked.size());
}
@Test
public void selectOne() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
$(SelectItem.class).withText("One").first().click();
test($(Button.class).atIndex(2)).click();
// Assert that span containing the value prints out in correct order
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals("One selected!", value);
// Assert button states are correct
Assert.assertTrue(test($(Button.class).atIndex(1)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(2)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(3)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(4)).isUsable());
Assert.assertTrue(test($(Button.class).atIndex(5)).isUsable());
}
@Test
public void addRefresh() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
test($(Select.class).first()).selectItem("SINGLE");
Assert.assertEquals("Item count: 10",
test($(Notification.class).last()).getText());
test($(Button.class).withCaption("Add/Refresh").first()).click();
Assert.assertEquals("Item count: 11",
test($(Notification.class).last()).getText());
$(SelectItem.class).withText("New 1").first().click();
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals("New 1 selected!", value);
}
@Test
public void selectNineDisabled() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
test($(Button.class).withCaption("Disable nine").first()).click();
// Check "Nine" is disabled
Assert.assertFalse(
$(SelectItem.class).withText("Nine").first().isEnabled());
test($(Button.class).withCaption("Select").first()).click();
// Assert that span containing the value prints out right value
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals("Eight,Nine,Ten selected!", value);
Assert.assertEquals(7, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(3, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
}
@Test
public void selectAllNineDisabled() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
test($(Button.class).withCaption("Disable nine").first()).click();
test($(Button.class).atIndex(1)).click();
// Assert that span containing the value prints out right value
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals(
"One,Two,Three,Four,Five,Six,Seven,Eight,Ten selected!", value);
// Options has one and value has 9 items
Assert.assertEquals(1, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(9, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
}
@Test
public void paintAllNineDisabled() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
test($(Button.class).withCaption("Disable nine").first()).click();
test($(Button.class).atIndex(5)).click();
test($(Button.class).atIndex(2)).click();
// Assert that span containing the value prints out right value
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals(
"One,Two,Three,Four,Five,Six,Seven,Eight,Ten selected!", value);
// Options has one and value has 9 items
Assert.assertEquals(1, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(9, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
}
@Test
public void programmaticSelectionResetsFilter() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
// Set the filter to be "T"
test($(TextField.class).withCaption("Filter").first()).setValue("T");
// Do programmatic select
test($(Button.class).withCaption("Select").first()).click();
// Assert that span containing the value prints out right value
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals("Eight,Nine,Ten selected!", value);
Assert.assertEquals(7, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(3, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
}
@Test
public void selectItemsAndFilter() {
navigate(View.class);
// Populate the TwinColSelect by clicking set button
test($(Button.class).withCaption("Set").first()).click();
$(SelectItem.class).withText("Eight").first().click();
$(SelectItem.class).withText("Nine").first().click();
$(SelectItem.class).withText("Ten").first().click();
test($(Button.class).atIndex(2)).click();
// Assert that span containing the value prints out right value
String value = test($(Span.class).id("value")).getText();
Assert.assertEquals("Eight,Nine,Ten selected!", value);
Assert.assertEquals(7, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(3, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
// Set the filter to be "T"
test($(TextField.class).withCaption("Filter").first()).setValue("T");
List<SelectItem> filtered = $(SelectItem.class,
$(VerticalLayout.class).withClassName("options").first()).all();
// Assert that we have right values, i.e. ones starting with "T", except
// "Ten" which is selected
Assert.assertEquals("Two", filtered.get(0).getLabel());
Assert.assertEquals("Three", filtered.get(1).getLabel());
Assert.assertEquals(2, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(3, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
// Set the filter to be "T"
test($(TextField.class).withCaption("Filter").first()).setValue("");
Assert.assertEquals(7, $(VerticalLayout.class).withClassName("options")
.first().getComponentCount());
Assert.assertEquals(3, $(VerticalLayout.class).withClassName("value")
.first().getComponentCount());
}
@Override
public boolean printTree() {
return true;
}
}