IDEMPIERE-92 - Integrate Selenium. Include only id space owner's id as part of component uuid to make it easier to extract zk id locator from generated html id.

This commit is contained in:
Heng Sin Low 2012-12-11 01:13:10 +08:00
parent 514e2a8f38
commit fbb79c0c91
1 changed files with 7 additions and 3 deletions

View File

@ -19,6 +19,7 @@ import java.util.regex.Pattern;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.IdSpace;
import org.zkoss.zk.ui.Page;
import org.zkoss.zk.ui.metainfo.ComponentInfo;
import org.zkoss.zk.ui.sys.IdGenerator;
@ -50,9 +51,12 @@ public class AdempiereIdGenerator implements IdGenerator {
StringBuilder builder = new StringBuilder(prefix);
Component parent = comp.getParent();
while(parent != null) {
String id = parent.getId();
if (id != null && id.length() > 0)
builder.insert(0, id+"_");
//only include id space owner to ease converting test case to use zk id selector instead of uuid
if (parent instanceof IdSpace) {
String id = parent.getId();
if (id != null && id.length() > 0)
builder.insert(0, id+"_");
}
parent = parent.getParent();
}
prefix = builder.toString();