7
7
import android .support .test .rule .ActivityTestRule ;
8
8
import android .support .test .runner .AndroidJUnit4 ;
9
9
10
+ import org .junit .After ;
10
11
import org .junit .Rule ;
11
12
import org .junit .Test ;
12
13
import org .junit .runner .RunWith ;
@@ -29,6 +30,12 @@ public class MainActivityTest {
29
30
public ActivityTestRule <MainActivity > activityRule = new ActivityTestRule <>(
30
31
MainActivity .class , false , true );
31
32
33
+
34
+ @ After
35
+ public void onEndTest () {
36
+ pressBack ();
37
+ }
38
+
32
39
@ Test
33
40
public void pieChartTest () {
34
41
onView (withId (R .id .recycler_view ))
@@ -41,8 +48,6 @@ public void pieChartTest() {
41
48
onWebView ().withElement (findElement (Locator .ID , "ac_path_1s" )).perform (webClick ());
42
49
onWebView ().withElement (findElement (Locator .ID , "ac_path_1t" )).perform (webClick ());
43
50
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
44
-
45
- pressBack ();
46
51
}
47
52
48
53
@ Test
@@ -61,8 +66,6 @@ public void columnChartTest() {
61
66
onWebView ().withElement (findElement (Locator .ID , "ac_path_16" )).perform (webClick ());
62
67
onWebView ().withElement (findElement (Locator .ID , "ac_path_17" )).perform (webClick ());
63
68
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
64
-
65
- pressBack ();
66
69
}
67
70
68
71
@ Test
@@ -75,8 +78,6 @@ public void lineChartTest() {
75
78
onWebView ().withElement (findElement (Locator .ID , "ac_path_20" )).perform (webClick ());
76
79
onWebView ().withElement (findElement (Locator .ID , "ac_path_1m" )).perform (webClick ());
77
80
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
78
-
79
- pressBack ();
80
81
}
81
82
82
83
@ Test
@@ -88,8 +89,6 @@ public void areaChartTest() {
88
89
onWebView ().withElement (findElement (Locator .ID , "ac_path_23" )).perform (webClick ());
89
90
onWebView ().withElement (findElement (Locator .ID , "ac_path_24" )).perform (webClick ());
90
91
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
91
-
92
- pressBack ();
93
92
}
94
93
95
94
@ Test
@@ -120,8 +119,6 @@ public void barChartTest() {
120
119
onWebView ().withElement (findElement (Locator .ID , "ac_path_3q" )).perform (webClick ());
121
120
onWebView ().withElement (findElement (Locator .ID , "ac_path_3r" )).perform (webClick ());
122
121
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
123
-
124
- pressBack ();
125
122
}
126
123
127
124
@ Test
@@ -137,8 +134,6 @@ public void vennDiagramTest() {
137
134
onWebView ().withElement (findElement (Locator .ID , "ac_path_a" )).perform (webClick ());
138
135
onWebView ().withElement (findElement (Locator .ID , "ac_path_x" )).perform (webClick ());
139
136
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
140
-
141
- pressBack ();
142
137
}
143
138
144
139
@ Test
@@ -173,8 +168,6 @@ public void heatMapChartTest() {
173
168
onWebView ().withElement (findElement (Locator .ID , "ac_rect_1i" )).perform (webClick ());
174
169
onWebView ().withElement (findElement (Locator .ID , "ac_rect_1j" )).perform (webClick ());
175
170
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
176
-
177
- pressBack ();
178
171
}
179
172
180
173
@ Test
@@ -187,8 +180,6 @@ public void tagCloudTest() {
187
180
onWebView ().withElement (findElement (Locator .ID , "ac_simple-text_s" )).perform (webClick ());
188
181
onWebView ().withElement (findElement (Locator .ID , "ac_simple-text_2a" )).perform (webClick ());
189
182
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
190
-
191
- pressBack ();
192
183
}
193
184
194
185
@ Test
@@ -212,8 +203,6 @@ public void waterfallChartTest() {
212
203
onWebView ().withElement (findElement (Locator .ID , "ac_path_1s" )).perform (webClick ());
213
204
onWebView ().withElement (findElement (Locator .ID , "ac_path_1t" )).perform (webClick ());
214
205
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
215
-
216
- pressBack ();
217
206
}
218
207
219
208
@ Test
@@ -237,8 +226,6 @@ public void treeMapChartTest() {
237
226
onWebView ().withElement (findElement (Locator .ID , "ac_rect_12" )).perform (webClick ());
238
227
onWebView ().withElement (findElement (Locator .ID , "ac_rect_13" )).perform (webClick ());
239
228
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
240
-
241
- pressBack ();
242
229
}
243
230
244
231
@ Test
@@ -253,8 +240,6 @@ public void circularGaugeTest() {
253
240
onWebView ().withElement (findElement (Locator .ID , "ac_path_e" )).perform (webClick ());
254
241
onWebView ().withElement (findElement (Locator .ID , "ac_path_f" )).perform (webClick ());
255
242
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
256
-
257
- pressBack ();
258
243
}
259
244
260
245
@ Test
@@ -264,8 +249,6 @@ public void thermometerTest() {
264
249
265
250
onWebView ().withElement (findElement (Locator .ID , "container" )).perform (webClick ());
266
251
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
267
-
268
- pressBack ();
269
252
}
270
253
271
254
@ Test
@@ -275,8 +258,6 @@ public void linearColorScaleTest() {
275
258
276
259
onWebView ().withElement (findElement (Locator .ID , "container" )).perform (webClick ());
277
260
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
278
-
279
- pressBack ();
280
261
}
281
262
282
263
@ Test
@@ -287,8 +268,6 @@ public void windSpeedTest() {
287
268
onWebView ().withElement (findElement (Locator .ID , "container" )).perform (webClick ());
288
269
onWebView ().withElement (findElement (Locator .ID , "ac_path_1l" )).perform (webClick ());
289
270
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
290
-
291
- pressBack ();
292
271
}
293
272
294
273
@ Test
@@ -299,8 +278,6 @@ public void windDirectionTest() {
299
278
onWebView ().withElement (findElement (Locator .ID , "container" )).perform (webClick ());
300
279
onWebView ().withElement (findElement (Locator .ID , "ac_path_y" )).perform (webClick ());
301
280
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
302
-
303
- pressBack ();
304
281
}
305
282
306
283
@ Test
@@ -312,8 +289,6 @@ public void scatterChartTest() {
312
289
onWebView ().withElement (findElement (Locator .ID , "ac_path_13" )).perform (webClick ());
313
290
onWebView ().withElement (findElement (Locator .ID , "ac_path_6a" )).perform (webClick ());
314
291
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
315
-
316
- pressBack ();
317
292
}
318
293
319
294
@ Test
@@ -326,8 +301,6 @@ public void resourceChartTest() {
326
301
onWebView ().withElement (findElement (Locator .ID , "ac_path_7" )).perform (webClick ());
327
302
onWebView ().withElement (findElement (Locator .ID , "ac_path_9" )).perform (webClick ());
328
303
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
329
-
330
- pressBack ();
331
304
}
332
305
333
306
@ Test
@@ -340,8 +313,6 @@ public void radarChartTest() {
340
313
onWebView ().withElement (findElement (Locator .ID , "ac_path_2k" )).perform (webClick ());
341
314
onWebView ().withElement (findElement (Locator .ID , "ac_path_22" )).perform (webClick ());
342
315
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
343
-
344
- pressBack ();
345
316
}
346
317
347
318
@ Test
@@ -354,8 +325,6 @@ public void polarChartTest() {
354
325
onWebView ().withElement (findElement (Locator .ID , "ac_path_2a" )).perform (webClick ());
355
326
onWebView ().withElement (findElement (Locator .ID , "ac_path_2d" )).perform (webClick ());
356
327
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
357
-
358
- pressBack ();
359
328
}
360
329
361
330
@ Test
@@ -376,8 +345,6 @@ public void rangeChartTest() {
376
345
onWebView ().withElement (findElement (Locator .ID , "ac_path_31" )).perform (webClick ());
377
346
onWebView ().withElement (findElement (Locator .ID , "ac_path_30" )).perform (webClick ());
378
347
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
379
-
380
- pressBack ();
381
348
}
382
349
383
350
@ Test
@@ -404,8 +371,6 @@ public void verticalChartTest() {
404
371
onWebView ().withElement (findElement (Locator .ID , "ac_path_1l" )).perform (webClick ());
405
372
onWebView ().withElement (findElement (Locator .ID , "ac_path_1m" )).perform (webClick ());
406
373
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
407
-
408
- pressBack ();
409
374
}
410
375
411
376
@ Test
@@ -420,8 +385,6 @@ public void funnelChartTest() {
420
385
onWebView ().withElement (findElement (Locator .ID , "ac_path_k" )).perform (webClick ());
421
386
onWebView ().withElement (findElement (Locator .ID , "ac_path_l" )).perform (webClick ());
422
387
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
423
-
424
- pressBack ();
425
388
}
426
389
427
390
@ Test
@@ -447,8 +410,6 @@ public void pertChartTest() {
447
410
onWebView ().withElement (findElement (Locator .ID , "ac_path_1h" )).perform (webClick ());
448
411
onWebView ().withElement (findElement (Locator .ID , "ac_path_1a" )).perform (webClick ());
449
412
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
450
-
451
- pressBack ();
452
413
}
453
414
454
415
@ Test
@@ -460,8 +421,6 @@ public void combinedChartTest() {
460
421
onWebView ().withElement (findElement (Locator .ID , "ac_path_1u" )).perform (webClick ());
461
422
onWebView ().withElement (findElement (Locator .ID , "ac_path_1x" )).perform (webClick ());
462
423
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
463
-
464
- pressBack ();
465
424
}
466
425
467
426
@ Test
@@ -478,8 +437,6 @@ public void bubbleChartTest() {
478
437
onWebView ().withElement (findElement (Locator .ID , "ac_circle_2r" )).perform (webClick ());
479
438
onWebView ().withElement (findElement (Locator .ID , "ac_circle_3u" )).perform (webClick ());
480
439
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
481
-
482
- pressBack ();
483
440
}
484
441
485
442
@ Test
@@ -491,8 +448,6 @@ public void paretoChartTest() {
491
448
onWebView ().withElement (findElement (Locator .ID , "ac_path_2k" )).perform (webClick ());
492
449
onWebView ().withElement (findElement (Locator .ID , "ac_path_2l" )).perform (webClick ());
493
450
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
494
-
495
- pressBack ();
496
451
}
497
452
498
453
@ Test
@@ -506,8 +461,6 @@ public void pyramidChartTest() {
506
461
onWebView ().withElement (findElement (Locator .ID , "ac_path_r" )).perform (webClick ());
507
462
onWebView ().withElement (findElement (Locator .ID , "ac_path_i" )).perform (webClick ());
508
463
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
509
-
510
- pressBack ();
511
464
}
512
465
513
466
@ Test
@@ -526,8 +479,6 @@ public void boxChartTest() {
526
479
onWebView ().withElement (findElement (Locator .ID , "ac_path_1p" )).perform (webClick ());
527
480
onWebView ().withElement (findElement (Locator .ID , "ac_path_1t" )).perform (webClick ());
528
481
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
529
-
530
- pressBack ();
531
482
}
532
483
533
484
@ Test
@@ -540,8 +491,6 @@ public void mosaicChartTest() {
540
491
onWebView ().withElement (findElement (Locator .ID , "ac_path_1o" )).perform (webClick ());
541
492
onWebView ().withElement (findElement (Locator .ID , "ac_path_1p" )).perform (webClick ());
542
493
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
543
-
544
- pressBack ();
545
494
}
546
495
547
496
@ Test
@@ -557,8 +506,6 @@ public void mekkoChartTest() {
557
506
onWebView ().withElement (findElement (Locator .ID , "ac_path_1b" )).perform (webClick ());
558
507
onWebView ().withElement (findElement (Locator .ID , "ac_path_1a" )).perform (webClick ());
559
508
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
560
-
561
- pressBack ();
562
509
}
563
510
564
511
@ Test
@@ -580,8 +527,6 @@ public void bar3DChartTest() {
580
527
onWebView ().withElement (findElement (Locator .ID , "ac_path_3n" )).perform (webClick ());
581
528
onWebView ().withElement (findElement (Locator .ID , "ac_path_4b" )).perform (webClick ());
582
529
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
583
-
584
- pressBack ();
585
530
}
586
531
587
532
@ Test
@@ -602,8 +547,6 @@ public void column3DChartTest() {
602
547
onWebView ().withElement (findElement (Locator .ID , "ac_path_2w" )).perform (webClick ());
603
548
onWebView ().withElement (findElement (Locator .ID , "ac_path_6r" )).perform (webClick ());
604
549
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
605
-
606
- pressBack ();
607
550
}
608
551
609
552
@ Test
@@ -615,8 +558,6 @@ public void area3DChartTest() {
615
558
onWebView ().withElement (findElement (Locator .ID , "ac_path_2j" )).perform (webClick ());
616
559
onWebView ().withElement (findElement (Locator .ID , "ac_path_23" )).perform (webClick ());
617
560
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
618
-
619
- pressBack ();
620
561
}
621
562
622
563
@ Test
@@ -628,8 +569,6 @@ public void hiloChartTest() {
628
569
onWebView ().withElement (findElement (Locator .ID , "ac_path_2b" )).perform (webClick ());
629
570
onWebView ().withElement (findElement (Locator .ID , "ac_path_3b" )).perform (webClick ());
630
571
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
631
-
632
- pressBack ();
633
572
}
634
573
635
574
@ Test
@@ -639,8 +578,6 @@ public void ohlcChartTest() {
639
578
640
579
onWebView ().withElement (findElement (Locator .ID , "container" )).perform (webClick ());
641
580
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
642
-
643
- pressBack ();
644
581
}
645
582
646
583
@ Test
@@ -659,8 +596,6 @@ public void quadrantChartTest() {
659
596
onWebView ().withElement (findElement (Locator .ID , "ac_path_d" )).perform (webClick ());
660
597
onWebView ().withElement (findElement (Locator .ID , "ac_path_f" )).perform (webClick ());
661
598
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
662
-
663
- pressBack ();
664
599
}
665
600
666
601
@ Test
@@ -677,8 +612,6 @@ public void sunburstChartTest() {
677
612
onWebView ().withElement (findElement (Locator .ID , "ac_path_5" )).perform (webClick ());
678
613
onWebView ().withElement (findElement (Locator .ID , "ac_path_5" )).perform (webClick ());
679
614
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
680
-
681
- pressBack ();
682
615
}
683
616
684
617
@ Test
@@ -700,8 +633,6 @@ public void bubbleMapTest() {
700
633
onWebView ().withElement (findElement (Locator .ID , "ac_circle_11" )).perform (webClick ());
701
634
onWebView ().withElement (findElement (Locator .ID , "ac_circle_x" )).perform (webClick ());
702
635
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
703
-
704
- pressBack ();
705
636
}
706
637
707
638
@ Test
@@ -717,8 +648,6 @@ public void choroplethMapTest() {
717
648
onWebView ().withElement (findElement (Locator .ID , "ac_path_10" )).perform (webClick ());
718
649
onWebView ().withElement (findElement (Locator .ID , "ac_path_s" )).perform (webClick ());
719
650
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
720
-
721
- pressBack ();
722
651
}
723
652
724
653
@ Test
@@ -735,8 +664,6 @@ public void pointMapTest() {
735
664
onWebView ().withElement (findElement (Locator .ID , "ac_path_25" )).perform (webClick ());
736
665
onWebView ().withElement (findElement (Locator .ID , "ac_path_26" )).perform (webClick ());
737
666
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
738
-
739
- pressBack ();
740
667
}
741
668
742
669
@ Test
@@ -751,8 +678,6 @@ public void connectorMapTest() {
751
678
onWebView ().withElement (findElement (Locator .ID , "ac_path_7l" )).perform (webClick ());
752
679
onWebView ().withElement (findElement (Locator .ID , "ac_path_7m" )).perform (webClick ());
753
680
onView (withId (R .id .web_view )).check (matches (isEnabled ()));
754
-
755
- pressBack ();
756
681
}
757
682
758
683
}
0 commit comments