From 92dc282c1cdac2aa3313996e7f3f0dfeb46b764d Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 5 Feb 2013 23:01:41 +0800 Subject: [PATCH] IDEMPIERE-529 Search on empty table doesn't allow to close the window. Fitnesse test. --- .../ZkSuite/SearchOnEmptyTable/content.txt | 14 ++++++++++++++ .../ZkSuite/SearchOnEmptyTable/properties.xml | 12 ++++++++++++ .../org/adempiere/webui/component/Messagebox.java | 10 +++++++++- .../src/fitlibrary/zk/ZkFixture.java | 1 + 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 fitnesse/FitNesseRoot/ZkSuite/SearchOnEmptyTable/content.txt create mode 100644 fitnesse/FitNesseRoot/ZkSuite/SearchOnEmptyTable/properties.xml diff --git a/fitnesse/FitNesseRoot/ZkSuite/SearchOnEmptyTable/content.txt b/fitnesse/FitNesseRoot/ZkSuite/SearchOnEmptyTable/content.txt new file mode 100644 index 0000000000..d37f526303 --- /dev/null +++ b/fitnesse/FitNesseRoot/ZkSuite/SearchOnEmptyTable/content.txt @@ -0,0 +1,14 @@ +http://jira.idempiere.com/browse/IDEMPIERE-529 + +!include -c .ZkSuite.ZkGardenAdminLogin + +!define windowId {$Activity__ABC__1} + +Open Activity (ABC) window +|''open window''|!-Activity (ABC)-!| +|''wait response'' | + +|''window'' |${windowId}|''click toolbar''|!-BtnFind-!| +|''click''|$MessageBox_Activity__ABC_ $btnOk| +|''window'' |${windowId}|''click toolbar''|!-BtnIgnore-!| +|''attribute''|class|''of''|${windowId} $BtnSave|is|!-toolbar-button disableFilter z-toolbarbutton z-toolbarbutton-disd-!| diff --git a/fitnesse/FitNesseRoot/ZkSuite/SearchOnEmptyTable/properties.xml b/fitnesse/FitNesseRoot/ZkSuite/SearchOnEmptyTable/properties.xml new file mode 100644 index 0000000000..3e87512357 --- /dev/null +++ b/fitnesse/FitNesseRoot/ZkSuite/SearchOnEmptyTable/properties.xml @@ -0,0 +1,12 @@ + + + true + true + true + true + true + true + + true + true + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Messagebox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Messagebox.java index 0b7f8a0238..092c4d3868 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Messagebox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Messagebox.java @@ -20,6 +20,7 @@ package org.adempiere.webui.component; import java.util.Properties; import org.adempiere.util.Callback; +import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.apps.AEnv; import org.compiere.util.Env; @@ -115,35 +116,42 @@ public class Messagebox extends Window implements EventListener // Invert - Unify OK/Cancel IDEMPIERE-77 //btnOk.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "OK"))); btnOk.setImage("/images/Ok16.png"); + btnOk.setId("btnOk"); btnOk.addEventListener(Events.ON_CLICK, this); LayoutUtils.addSclass("action-text-button", btnOk); //btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Cancel"))); btnCancel.setImage("/images/Cancel16.png"); btnCancel.addEventListener(Events.ON_CLICK, this); + btnCancel.setId("btnCancel"); LayoutUtils.addSclass("action-text-button", btnCancel); btnYes.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Yes"))); btnYes.setImage("/images/Ok16.png"); btnYes.addEventListener(Events.ON_CLICK, this); + btnYes.setId("btnYes"); LayoutUtils.addSclass("action-text-button", btnYes); btnNo.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "No"))); btnNo.setImage("/images/Cancel16.png"); btnNo.addEventListener(Events.ON_CLICK, this); + btnNo.setId("btnNo"); LayoutUtils.addSclass("action-text-button", btnNo); btnAbort.setLabel("Abort"); btnAbort.addEventListener(Events.ON_CLICK, this); + btnAbort.setId("btnAbort"); LayoutUtils.addSclass("action-text-button", btnAbort); btnRetry.setLabel("Retry"); btnRetry.addEventListener(Events.ON_CLICK, this); + btnRetry.setId("btnRetry"); LayoutUtils.addSclass("action-text-button", btnRetry); btnIgnore.setLabel("Ignore"); btnIgnore.setImage("/images/Ignore16.png"); btnIgnore.addEventListener(Events.ON_CLICK, this); + btnIgnore.setId("btnIgnore"); LayoutUtils.addSclass("action-text-button", btnIgnore); Panel pnlMessage = new Panel(); @@ -248,7 +256,7 @@ public class Messagebox extends Window implements EventListener this.setSizable(true); this.setVisible(true); - this.setId(title); + this.setId("MessageBox_"+AdempiereIdGenerator.escapeId(title)); AEnv.showCenterScreen(this); return returnValue; diff --git a/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java b/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java index 5bc8a9544d..45186d604b 100644 --- a/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java +++ b/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java @@ -134,6 +134,7 @@ public class ZkFixture extends SpiderFixture { public void openWindow(String label) { Widget widget = new Widget("$treeSearchCombo"); String search = label.indexOf("&") > 0 ? label.substring(0, label.indexOf("&")) : label; + search = search.indexOf("(") > 0 ? search.substring(0, search.indexOf("(")) : search; WebElement element = widget.$n(webDriver, "real"); element.sendKeys(search); waitResponse();