1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.travel.krad.test;
17
18 import static org.junit.Assert.*;
19
20 import org.junit.Test;
21 import edu.samplu.common.WebDriverLegacyITBase;
22
23
24
25
26
27
28 public class CollectionTotallingLegacyIT extends WebDriverLegacyITBase {
29
30
31
32
33
34
35 @Override
36 public String getTestUrl() {
37
38 return "/kr-krad/uicomponents?viewId=Demo-CollectionTotaling&methodToCall=start";
39 }
40
41 @Test
42 public void testCollectionTotalling() throws InterruptedException {
43
44
45 assertEquals("Total: 419", getText("div#Demo-CollectionTotaling-Section1 div[role='grid'] div[data-label='Total']"));
46
47 clearText("div#Demo-CollectionTotaling-Section1 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section1] input[name='list1[0].field1']");
48 waitAndType("div#Demo-CollectionTotaling-Section1 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section1] input[name='list1[0].field1']","10");
49 waitAndClick("div#Demo-CollectionTotaling-Section1 div[role='grid'] div[data-label='Total']");
50
51 Thread.sleep(5000);
52 assertEquals("Total: 424", getText("div#Demo-CollectionTotaling-Section1 div[role='grid'] div[data-label='Total']"));
53
54
55
56 assertEquals("Total: 419", getText("div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']"));
57 clearText("div#Demo-CollectionTotaling-Section2 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section2] input[name='list1[0].field1']");
58 waitAndType("div#Demo-CollectionTotaling-Section2 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section2] input[name='list1[0].field1']","9");
59 waitAndClick("div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']");
60
61 Thread.sleep(5000);
62 assertEquals("Total: 423", getText("div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']"));
63
64
65
66 assertEquals("", getTextByXpath("//div[3]/div[3]/table/tfoot/tr/th[2]"));
67
68 assertEquals("Total: 369", getTextByXpath("//div[3]/div[3]/table/tfoot/tr/th[3]/div/fieldset/div/div[2]/div[2]"));
69
70
71
72 assertEquals("Total:", getTextByXpath("//*[@id='u100213_span']"));
73 assertEquals("419", getTextByXpath("//div[4]/div[3]/table/tfoot/tr/th[2]/div/fieldset/div/div[2]/div[2]"));
74
75
76 assertEquals("Total: 382", getTextByXpath("//div[2]/div/fieldset/div/div[2]/div[2]"));
77 clearText("div#Demo-CollectionTotaling-Section6 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section6] input[name='list1[0].field4']");
78 waitAndType("div#Demo-CollectionTotaling-Section6 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section6] input[name='list1[0].field4']","11");
79 waitAndClick("div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']");
80
81 Thread.sleep(5000);
82 assertEquals("Total: 385", getTextByXpath("//div[2]/div/fieldset/div/div[2]/div[2]"));
83
84
85 clearText("div#Demo-CollectionTotaling-Section6 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section6] input[name='list1[0].field4']");
86 waitAndType("div#Demo-CollectionTotaling-Section6 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section6] input[name='list1[0].field4']","15.25");
87 waitAndClick("div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']");
88
89 Thread.sleep(5000);
90 assertEquals("Page Average: 11.917", getTextByXpath("//div[2]/fieldset/div/div[2]/div"));
91
92 }
93
94 }