1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.timezone.service;
17
18 import java.util.LinkedHashMap;
19 import java.util.Map;
20
21 import org.junit.Assert;
22 import org.junit.Test;
23 import org.kuali.hr.test.KPMETestCase;
24 import org.kuali.hr.time.test.HtmlUnitUtil;
25 import org.kuali.hr.time.test.TkTestConstants;
26 import org.kuali.hr.time.test.TkTestUtils;
27
28 import com.gargoylesoftware.htmlunit.html.HtmlPage;
29
30 public class TimezoneTest extends KPMETestCase {
31
32 @Test
33 public void testClockInOutWithTimezone() throws Exception {
34 HtmlPage page = HtmlUnitUtil.gotoPageAndLogin(getWebClient(), TkTestConstants.Urls.CLOCK_URL,true);
35 Assert.assertNotNull(page);
36
37 Map<String, Object> criteria = new LinkedHashMap<String, Object>();
38 criteria.put("selectedAssignment", new String[]{TkTestConstants.FormElementTypes.DROPDOWN, "30_30_30"});
39
40 page = TkTestUtils.fillOutForm(page, criteria);
41 Assert.assertNotNull(page);
42
43 page = TkTestUtils.clickButton(page, "clockAction");
44
45 page = TkTestUtils.clickButton(page, "clockAction");
46 HtmlUnitUtil.createTempFile(page);
47 Assert.assertTrue("Time zone information is incorrect", page.asText().contains("Eastern"));
48 }
49 }