Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test case for ZK-2152, ZK-2400, ZK-2414.
- Loading branch information
Showing
6 changed files
with
270 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
zstl/test/org/zkoss/zktest/test2/B70/B70_ZK_2152Test.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
package org.zkoss.zktest.test2.B70 | ||
|
||
import org.zkoss.ztl.Tags | ||
import org.zkoss.zstl.ZTL4ScalaTestCase | ||
import org.junit.Test | ||
import java.awt.event.KeyEvent | ||
import org.openqa.selenium.Keys | ||
import org.zkoss.ztl.ZKSeleneseTestBase | ||
|
||
@Tags(tags = "B70-ZK-2152.zul") | ||
class B70_ZK_2152Test extends ZTL4ScalaTestCase { | ||
|
||
@Test | ||
def testClick() = { | ||
val zscript = """<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
B70-ZK-2152.zul | ||
Purpose: | ||
Description: | ||
History: | ||
Mon, June 20, 2014 14:16:12 PM, Created by jerrychen | ||
Copyright (C) Potix Corporation. All Rights Reserved. | ||
--> | ||
<zk> | ||
<zscript> | ||
String string = "10/10/2014 05:00:00"; | ||
Date date = null; | ||
try{ | ||
date = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss", Locale.ENGLISH).parse(string); | ||
} catch(Exception ex){} | ||
</zscript> | ||
<div> | ||
1. click datebox and input specified time into timebox. | ||
<separator/> | ||
2. if there's not the result as expected, it's a bug. | ||
<separator/> | ||
</div> | ||
<div> | ||
21:00:00 => 10/10/2014 21:00:00 | ||
<separator/> | ||
<datebox cols="30" format="MM/dd/yyyy HH:mm:ss" | ||
onCreate="self.value = date" width="230px" /> | ||
</div> | ||
<div> | ||
11:00:00 => 10/10/2014 11:00:00 AM | ||
<separator/> | ||
<datebox cols="30" format="MM/dd/yyyy hh:mm:ss a" | ||
onCreate="self.value = date" width="230px" /> | ||
</div> | ||
<div> | ||
11:00:00 => 10/10/2014 11:00:00 AM | ||
<separator/> | ||
<datebox cols="30" format="MM/dd/yyyy KK:mm:ss a" | ||
onCreate="self.value = date" width="230px" /> | ||
</div> | ||
<div> | ||
21:00:00 => 10/10/2014 21:00:00 | ||
<separator/> | ||
<datebox cols="30" format="MM/dd/yyyy kk:mm:ss" | ||
onCreate="self.value = date" width="230px" /> | ||
</div> | ||
</zk> | ||
""" | ||
runZTL(zscript, | ||
() => { | ||
clickAt(jq(".z-datebox-button").eq(0), "1,1"); | ||
waitResponse(); | ||
var inp = jq(".z-timebox-input").eq(0); | ||
zk(inp).eval("setSelectionRange(0);'test'"); | ||
waitResponse(); | ||
keyPress(inp, "210000"); | ||
waitResponse(); | ||
sendKeys(inp, Keys.ENTER); | ||
waitResponse(); | ||
verifyTrue(jq("@datebox").eq(0).toWidget().get("text").equals("10/10/2014 21:00:00")); | ||
|
||
clickAt(jq(".z-datebox-button").eq(1), "1,1"); | ||
waitResponse(); | ||
inp = jq(".z-timebox-input").eq(1); | ||
zk(inp).eval("setSelectionRange(0);'test'"); | ||
waitResponse(); | ||
keyPress(inp, "110000"); | ||
waitResponse(); | ||
sendKeys(inp, Keys.ARROW_RIGHT); | ||
waitResponse(); | ||
sendKeys(inp, Keys.ARROW_UP); | ||
waitResponse(); | ||
sendKeys(inp, Keys.ENTER); | ||
waitResponse(); | ||
verifyTrue(jq("@datebox").eq(1).toWidget().get("text").equals("10/10/2014 11:00:00 AM")); | ||
|
||
clickAt(jq(".z-datebox-button").eq(2), "1,1"); | ||
waitResponse(); | ||
inp = jq(".z-timebox-input").eq(2); | ||
zk(inp).eval("setSelectionRange(0);'test'"); | ||
waitResponse(); | ||
keyPress(inp, "110000"); | ||
waitResponse(); | ||
sendKeys(inp, Keys.ARROW_RIGHT); | ||
waitResponse(); | ||
sendKeys(inp, Keys.ARROW_UP); | ||
waitResponse(); | ||
sendKeys(inp, Keys.ENTER); | ||
waitResponse(); | ||
verifyTrue(jq("@datebox").eq(2).toWidget().get("text").equals("10/10/2014 11:00:00 AM")); | ||
|
||
clickAt(jq(".z-datebox-button").eq(3), "1,1"); | ||
waitResponse(); | ||
inp = jq(".z-timebox-input").eq(3); | ||
zk(inp).eval("setSelectionRange(0);'test'"); | ||
waitResponse(); | ||
keyPress(inp, "210000"); | ||
waitResponse(); | ||
sendKeys(inp, Keys.ENTER); | ||
waitResponse(); | ||
verifyTrue(jq("@datebox").eq(3).toWidget().get("text").equals("10/10/2014 21:00:00")); | ||
}) | ||
|
||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
zstl/test/org/zkoss/zktest/test2/B70/B70_ZK_2400Test.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.zkoss.zktest.test2.B70 | ||
|
||
import org.zkoss.ztl.Tags | ||
import org.zkoss.zstl.ZTL4ScalaTestCase | ||
import org.junit.Test | ||
import java.awt.event.KeyEvent | ||
import org.openqa.selenium.Keys | ||
import org.zkoss.ztl.ZKSeleneseTestBase | ||
|
||
@Tags(tags = "B70-ZK-2400.zul") | ||
class B70_ZK_2400Test extends ZTL4ScalaTestCase { | ||
|
||
@Test | ||
def testClick() = { | ||
val zscript = """<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
B70-ZK-2400.zul | ||
Purpose: | ||
Description: | ||
History: | ||
Thur, Aug 14, 2014 11:35:00 AM, Created by jerrychen | ||
Copyright (C) Potix Corporation. All Rights Reserved. | ||
--> | ||
<zk> | ||
<div> | ||
1. click up or down button. if you see the label changed as well without losing timebox's focus, it's a bug. | ||
</div> | ||
<timebox format="HH:mm" onChange="lbl.value = event.value"/> | ||
<separator/> | ||
value onChanged: <label id="lbl"/> | ||
<separator/> | ||
</zk> | ||
""" | ||
runZTL(zscript, | ||
() => { | ||
val btn = jq(".z-timebox-up"); | ||
clickAt(btn, "1,1"); | ||
waitResponse(); | ||
clickAt(btn, "1,1"); | ||
waitResponse(); | ||
verifyTrue("click up button shouldn't trigger onChange.", jq("$lbl").toWidget().get("value").equals("")); | ||
}) | ||
|
||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
zstl/test/org/zkoss/zktest/test2/B70/B70_ZK_2414Test.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package org.zkoss.zktest.test2.B70 | ||
|
||
import org.zkoss.ztl.Tags | ||
import org.zkoss.zstl.ZTL4ScalaTestCase | ||
import org.junit.Test | ||
import java.awt.event.KeyEvent | ||
import org.openqa.selenium.Keys | ||
import org.zkoss.ztl.ZKSeleneseTestBase | ||
|
||
@Tags(tags = "B70-ZK-2414.zul") | ||
class B70_ZK_2414Test extends ZTL4ScalaTestCase { | ||
|
||
@Test | ||
def testClick() = { | ||
val zscript = """<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
B70-ZK-2414.zul | ||
Purpose: | ||
Description: | ||
History: | ||
Fri, Aug 22, 2014 2:30:33 PM, Created by jumperchen | ||
Copyright (C) Potix Corporation. All Rights Reserved. | ||
--> | ||
<zk> | ||
<window id="mainWin" width="100%" height="100%" sclass="page-bg" > | ||
<div width="100%" vflex="80"> | ||
<hbox hflex="1" vflex="1"> | ||
<!-- empty div for alignment --> | ||
<div hflex="15">You should be able to see the "right" word in IE9/IE10</div> | ||
<div id="contentDiv" hflex="70" vflex="1"> | ||
<div id="financialDetailsWin" vflex="1" > | ||
<panel id="contentPanel" height="100%" hflex="1"> | ||
<panelchildren style="overflow:auto;border:solid 1px black"> | ||
center | ||
</panelchildren> | ||
</panel> | ||
<!-- SPACE element here causes the problem; | ||
- - caused ZK 7 width-calculation on IE to explode the width to 1600+ pixels. | ||
--> | ||
<space/> | ||
</div> | ||
</div> | ||
<div hflex="15" id="rLabel">right</div> | ||
</hbox> | ||
</div> | ||
</window> | ||
</zk> | ||
""" | ||
runZTL(zscript, | ||
() => { | ||
verifyTrue(jq("$rLabel").exists()); | ||
}) | ||
|
||
} | ||
} |