IDEMPIERE-4138 Move fitnesse integration from core. Move ztl
This commit is contained in:
parent
0caa446721
commit
602623af92
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="src" path="src"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
|
||||||
<classpathentry kind="lib" path="lib/ztl-2.0.0-SNAPSHOT.jar" sourcepath="lib/ztl-2.0.0-sources.jar"/>
|
|
||||||
<classpathentry kind="lib" path="/org.idempiere.fitnesse.server/lib/selenium-server-standalone-2.35.0.jar" sourcepath="/org.idempiere.fitnesse.server/lib/selenium-server-2.31.0-sources.jar"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
|
||||||
</classpath>
|
|
17
ztl/.project
17
ztl/.project
|
@ -1,17 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>ztl</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
|
@ -1,11 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
|
@ -1,18 +0,0 @@
|
||||||
config.properties
|
|
||||||
- configuration file for running Ztl generator and Ztl test
|
|
||||||
|
|
||||||
ZtlGenerator.launch
|
|
||||||
- Eclipse launch configuration for Ztl generator
|
|
||||||
|
|
||||||
test
|
|
||||||
- Example test cases generated by Ztl generator
|
|
||||||
|
|
||||||
resource/test
|
|
||||||
- ztl test script
|
|
||||||
|
|
||||||
Notes
|
|
||||||
======
|
|
||||||
* You must change the "target" instance variable value to "" in the generated ztl java source
|
|
||||||
|
|
||||||
* Use the AdempiereIDGenerator and your browser's inspect element tool to find out the selector for the element that you need to access. Alternatively,
|
|
||||||
you can use the script created from Selenium IDE recording as a guide.
|
|
|
@ -1,19 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
|
||||||
<listEntry value="/ztl/lib/ztl-2.0.0-SNAPSHOT.jar"/>
|
|
||||||
</listAttribute>
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
|
||||||
<listEntry value="1"/>
|
|
||||||
</listAttribute>
|
|
||||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
|
||||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" javaProject="ztl" path="1" type="4"/> "/>
|
|
||||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="ztl"/> </runtimeClasspathEntry> "/>
|
|
||||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/ztl/lib/commons-lang-2.4.jar" path="3" type="2"/> "/>
|
|
||||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/ztl/lib/velocity-1.7.jar" path="3" type="2"/> "/>
|
|
||||||
</listAttribute>
|
|
||||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.zkoss.ztl.util.ZtlGenerator"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-src resource -dist src"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ztl"/>
|
|
||||||
</launchConfiguration>
|
|
|
@ -1,11 +0,0 @@
|
||||||
server=http://127.0.0.1:8080
|
|
||||||
context-path=/webui
|
|
||||||
delay=500
|
|
||||||
action=
|
|
||||||
timeout=10000
|
|
||||||
browser=firefox
|
|
||||||
granularity=1
|
|
||||||
leniency=1
|
|
||||||
all=firefox
|
|
||||||
firefox=firefoxdriver
|
|
||||||
target=
|
|
|
@ -1,5 +0,0 @@
|
||||||
ztl-2.0.0-SNAPSHOT.jar
|
|
||||||
- for execution of ztl generator and ztl test cases
|
|
||||||
|
|
||||||
others
|
|
||||||
- for execution of ztl generator
|
|
|
@ -1,27 +0,0 @@
|
||||||
<test tags="login" action="">
|
|
||||||
<case id="login">
|
|
||||||
<client>
|
|
||||||
<![CDATA[
|
|
||||||
type(jq("$loginPanel $txtUserId"), "GardenAdmin");
|
|
||||||
type(jq("$loginPanel $txtPassword"), "GardenAdmin");
|
|
||||||
click(widget(jq("$loginPanel $chkSelectRole")).$n("real"));
|
|
||||||
click(jq("$loginPanel $Ok"));
|
|
||||||
waitResponse();
|
|
||||||
JQuery lstClient = jq("$rolePanel $lstClient");
|
|
||||||
if (lstClient.exists() && lstClient.isVisible()) {
|
|
||||||
click(jq("$rolePanel $lstClient ~ .z-combobox-btn"));
|
|
||||||
click(jq("$rolePanel $lstClient $GardenWorld"));
|
|
||||||
waitResponse();
|
|
||||||
}
|
|
||||||
click(jq("$rolePanel $lstRole ~ .z-combobox-btn"));
|
|
||||||
click(jq("$rolePanel $lstRole $GardenWorld\\\\ Admin"));
|
|
||||||
waitResponse();
|
|
||||||
click(jq("$rolePanel $lstOrganisation ~ .z-combobox-btn"));
|
|
||||||
click(jq("$rolePanel $lstOrganisation $HQ"));
|
|
||||||
click(jq("$rolePanel $Ok"));
|
|
||||||
waitResponse();
|
|
||||||
verifyEquals("GardenAdmin@GardenWorld.HQ/GardenWorld Admin", jq("$loginUserAndRole").text());
|
|
||||||
]]>
|
|
||||||
</client>
|
|
||||||
</case>
|
|
||||||
</test>
|
|
|
@ -1,87 +0,0 @@
|
||||||
/* LoginTest.java
|
|
||||||
|
|
||||||
Purpose:
|
|
||||||
|
|
||||||
Description:
|
|
||||||
|
|
||||||
History:
|
|
||||||
Dec, 11, 2012 00:52:22 AM
|
|
||||||
|
|
||||||
Copyright (C) 2012 Potix Corporation. All Rights Reserved.
|
|
||||||
|
|
||||||
This program is distributed under Apache License Version 2.0 in the hope that
|
|
||||||
it will be useful, but WITHOUT ANY WARRANTY.
|
|
||||||
*/
|
|
||||||
package test;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.zkoss.ztl.JQuery;
|
|
||||||
import org.zkoss.ztl.Tags;
|
|
||||||
import org.zkoss.ztl.Widget;
|
|
||||||
import org.zkoss.ztl.ZKClientTestCase;
|
|
||||||
import org.zkoss.ztl.util.ConfigHelper;
|
|
||||||
import org.zkoss.ztl.util.ZKSelenium;
|
|
||||||
|
|
||||||
import com.thoughtworks.selenium.Selenium;
|
|
||||||
import com.thoughtworks.selenium.SeleniumException;
|
|
||||||
|
|
||||||
@Tags(tags = "login")
|
|
||||||
public class LoginTest extends ZKClientTestCase {
|
|
||||||
|
|
||||||
public LoginTest() {
|
|
||||||
target = "";
|
|
||||||
browsers = getBrowsers("firefox");
|
|
||||||
_timeout = 10000;
|
|
||||||
caseID = getClass().getSimpleName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(expected = AssertionError.class)
|
|
||||||
public void testlogin() {
|
|
||||||
for (Selenium browser : browsers) {
|
|
||||||
try {
|
|
||||||
start(browser);
|
|
||||||
windowFocus();
|
|
||||||
windowMaximize();
|
|
||||||
Widget engine = new Widget(new StringBuffer("zk.Desktop._dt"));
|
|
||||||
|
|
||||||
// remove all of unnecessary children
|
|
||||||
if (target.endsWith("/service.zul"))
|
|
||||||
removeChildren(engine.firstChild());
|
|
||||||
|
|
||||||
/** start **/
|
|
||||||
/** client code **/
|
|
||||||
|
|
||||||
type(jq("$loginPanel $txtUserId"), "GardenAdmin");
|
|
||||||
type(jq("$loginPanel $txtPassword"), "GardenAdmin");
|
|
||||||
click(widget(jq("$loginPanel $chkSelectRole")).$n("real"));
|
|
||||||
click(jq("$loginPanel $Ok"));
|
|
||||||
waitResponse();
|
|
||||||
JQuery lstClient = jq("$rolePanel $lstClient");
|
|
||||||
if (lstClient.exists() && lstClient.isVisible()) {
|
|
||||||
click(jq("$rolePanel $lstClient ~ .z-combobox-btn"));
|
|
||||||
click(jq("$rolePanel $lstClient $GardenWorld"));
|
|
||||||
waitResponse();
|
|
||||||
}
|
|
||||||
click(jq("$rolePanel $lstRole ~ .z-combobox-btn"));
|
|
||||||
click(jq("$rolePanel $lstRole $GardenWorld\\\\ Admin"));
|
|
||||||
waitResponse();
|
|
||||||
click(jq("$rolePanel $lstOrganisation ~ .z-combobox-btn"));
|
|
||||||
click(jq("$rolePanel $lstOrganisation $HQ"));
|
|
||||||
click(jq("$rolePanel $Ok"));
|
|
||||||
waitResponse();
|
|
||||||
verifyEquals("GardenAdmin@GardenWorld.HQ/GardenWorld Admin", jq("$loginUserAndRole").text());
|
|
||||||
|
|
||||||
/** end **/
|
|
||||||
} catch (SeleniumException e) {
|
|
||||||
ZKSelenium zbrowser = ((ZKSelenium) browser);
|
|
||||||
ConfigHelper.getInstance().clearCache(zbrowser);
|
|
||||||
zbrowser.shutdown();
|
|
||||||
throw e;
|
|
||||||
} finally {
|
|
||||||
stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue