1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.compview;
17
18 import edu.samplu.common.UpgradedSeleniumITBase;
19 import junit.framework.Assert;
20 import org.junit.Test;
21
22 import static com.thoughtworks.selenium.SeleneseTestBase.assertTrue;
23
24
25
26
27
28
29
30 public class UifTooltipIT extends UpgradedSeleniumITBase {
31 private static final String NAME_FIELD_1 = "name=remoteFieldValuesMap[remoteField1]";
32 private static final String NAME_FIELD_2 = "name=remoteFieldValuesMap[remoteField2]";
33 @Override
34 public String getTestUrl() {
35
36 return "/kr-krad/uicomponents?viewId=UifCompView&methodToCall=start&pageId=UifCompView-Page10";
37 }
38
39 @Test
40 public void testTooltip() throws Exception {
41
42 fireEvent(NAME_FIELD_1, "focus");
43 fireEvent(NAME_FIELD_1, "over");
44 Assert.assertTrue(isVisible("css=div.jquerybubblepopup.jquerybubblepopup-black")
45 && isVisible("css=td.jquerybubblepopup-innerHtml"));
46 Assert.assertEquals("This tooltip is triggered by focus or and mouse over.", getText("css=td.jquerybubblepopup-innerHtml"));
47
48
49 fireEvent(NAME_FIELD_1, "blur");
50 Assert.assertFalse(isVisible("css=div.jquerybubblepopup.jquerybubblepopup-black")
51 && isVisible("css=td.jquerybubblepopup-innerHtml"));
52
53
54
55 mouseOver(NAME_FIELD_2);
56 Assert.assertTrue(isVisible("//td[contains(.,\"This is a tool-tip with different position and tail options\")]"));
57
58
59 mouseOut(NAME_FIELD_2);
60 Assert.assertFalse(isVisible("//td[contains(.,\"This is a tool-tip with different position and tail options\")]"));
61
62
63 waitAndType(NAME_FIELD_1, "1");
64 fireEvent(NAME_FIELD_1, "blur");
65 fireEvent(NAME_FIELD_1, "focus");
66 waitAndType(NAME_FIELD_1, "1");
67 Thread.sleep(2000);
68 assertTrue("https://jira.kuali.org/browse/KULRICE-8141 Investigate why UifTooltipIT.testTooltip fails around jquerybubblepopup",
69 isVisible("css=div.jquerybubblepopup.jquerybubblepopup-kr-error-cs") &&
70 !(isVisible("css=div.jquerybubblepopup.jquerybubblepopup-black")) &&
71 isVisible("css=img.uif-validationImage"));
72
73
74 }
75 }