IDEMPIERE-92 - Integrate Selenium. Make more class test ready.
This commit is contained in:
parent
fa2b6fa861
commit
a43e609451
|
@ -90,6 +90,8 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
|||
public static final String APP_NAME = "iDempiere";
|
||||
|
||||
public static final String UID = "1.0.0";
|
||||
|
||||
public static final String WIDGET_INSTANCE_NAME = "instanceName";
|
||||
|
||||
private WLogin loginDesktop;
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.LayoutUtils;
|
||||
import org.adempiere.webui.component.Borderlayout;
|
||||
import org.adempiere.webui.component.Column;
|
||||
|
@ -199,6 +200,7 @@ DataStatusListener, IADTabpanel, IdSpace
|
|||
form.setHeight(null);
|
||||
form.setVflex(false);
|
||||
form.setSclass("grid-layout adwindow-form");
|
||||
form.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "form");
|
||||
|
||||
listPanel = new GridView();
|
||||
listPanel.getListbox().addEventListener(Events.ON_DOUBLE_CLICK, this);
|
||||
|
@ -406,6 +408,7 @@ DataStatusListener, IADTabpanel, IdSpace
|
|||
editor.setADTabpanel(this);
|
||||
field.addPropertyChangeListener(editor);
|
||||
editors.add(editor);
|
||||
editor.getComponent().setId(field.getColumnName());
|
||||
toolbarButtonEditors.add(editor);
|
||||
|
||||
continue;
|
||||
|
@ -519,6 +522,8 @@ DataStatusListener, IADTabpanel, IdSpace
|
|||
|
||||
//stretch component to fill grid cell
|
||||
editor.fillHorizontal();
|
||||
|
||||
editor.getComponent().setId(field.getColumnName());
|
||||
|
||||
//setup editor context menu
|
||||
WEditorPopupMenu popupMenu = editor.getPopupMenu();
|
||||
|
@ -540,6 +545,8 @@ DataStatusListener, IADTabpanel, IdSpace
|
|||
popupMenu.addContextElement((XulElement) editor.getComponent());
|
||||
}
|
||||
}
|
||||
|
||||
popupMenu.setId(field.getColumnName()+"-popup");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
package org.adempiere.webui.adwindow;
|
||||
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.component.SimpleTreeModel;
|
||||
import org.adempiere.webui.component.ToolBarButton;
|
||||
import org.adempiere.webui.panel.TreeSearchPanel;
|
||||
|
@ -73,6 +74,7 @@ public class ADTreePanel extends Panel implements EventListener<Event>
|
|||
|
||||
private void init()
|
||||
{
|
||||
setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "treepanel");
|
||||
this.setWidth("100%");
|
||||
this.setHeight("100%");
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import java.util.Vector;
|
|||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.util.Callback;
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.LayoutUtils;
|
||||
import org.adempiere.webui.WArchive;
|
||||
import org.adempiere.webui.WRequest;
|
||||
|
@ -2742,6 +2743,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
@Override
|
||||
public void onProcess() {
|
||||
ProcessButtonPopup popup = new ProcessButtonPopup();
|
||||
popup.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "processButtonPopup");
|
||||
ADTabpanel adtab = (ADTabpanel) adTabbox.getSelectedTabpanel();
|
||||
popup.render(adtab.getToolbarButtons());
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.LayoutUtils;
|
||||
import org.adempiere.webui.component.Label;
|
||||
import org.adempiere.webui.component.Menupopup;
|
||||
|
@ -151,6 +152,7 @@ public class BreadCrumb extends Div implements EventListener<Event> {
|
|||
createPopup();
|
||||
|
||||
toolbar.setStyle("background-image: none; background-color: transparent; border: none;");
|
||||
setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "breadcrumb");
|
||||
}
|
||||
|
||||
public void setToolbarListener(ToolbarListener listener) {
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.zkoss.zk.au.out.AuFocus;
|
|||
import org.zkoss.zk.au.out.AuScript;
|
||||
import org.zkoss.zk.ui.AbstractComponent;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.IdSpace;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
|
@ -62,7 +63,7 @@ import org.zkoss.zul.event.ZulEvents;
|
|||
* @author Low Heng Sin
|
||||
*
|
||||
*/
|
||||
public class GridView extends Vbox implements EventListener<Event>
|
||||
public class GridView extends Vbox implements EventListener<Event>, IdSpace
|
||||
{
|
||||
private static final int DEFAULT_DETAIL_PAGE_SIZE = 10;
|
||||
|
||||
|
@ -131,6 +132,7 @@ public class GridView extends Vbox implements EventListener<Event>
|
|||
public GridView(int windowNo)
|
||||
{
|
||||
this.windowNo = windowNo;
|
||||
setId("gridView");
|
||||
createListbox();
|
||||
|
||||
this.setHflex("1");
|
||||
|
@ -519,6 +521,7 @@ public class GridView extends Vbox implements EventListener<Event>
|
|||
} else {
|
||||
gridFooter.setVisible(true);
|
||||
}
|
||||
paging.setId("paging");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -150,6 +150,7 @@ public class ProcessDialog extends Window implements EventListener<Event>, IProc
|
|||
message = new Html();
|
||||
messageDiv.appendChild(message);
|
||||
messageDiv.setStyle(MESSAGE_DIV_STYLE);
|
||||
messageDiv.setId("message");
|
||||
|
||||
north = new North();
|
||||
north.appendChild(messageDiv);
|
||||
|
|
|
@ -165,6 +165,7 @@ public class ProcessModalDialog extends Window implements EventListener<Event>,
|
|||
dialogBody = new VerticalBox();
|
||||
dialogBody.setHflex("1");
|
||||
Div div = new Div();
|
||||
div.setId("message");
|
||||
message = new Html();
|
||||
div.appendChild(message);
|
||||
div.setStyle("max-height: 150pt; overflow: auto;");
|
||||
|
|
|
@ -305,6 +305,8 @@ public class ProcessParameterPanel extends Panel implements
|
|||
m_mFields2.add(mField2);
|
||||
// The Editor
|
||||
WEditor editor2 = WebEditorFactory.getEditor(mField2, false);
|
||||
//override attribute
|
||||
editor2.getComponent().setWidgetAttribute("columnName", mField2.getColumnName()+"_To");
|
||||
// New Field value to be updated to editor
|
||||
mField2.addPropertyChangeListener(editor2);
|
||||
editor2.dynamicDisplay();
|
||||
|
|
|
@ -244,6 +244,7 @@ public final class ConfirmPanel extends Hbox
|
|||
this.appendChild(hboxBtnLeft);
|
||||
this.appendChild(hboxBtnRight);
|
||||
this.setSclass("confirm-panel");
|
||||
setId("confirmPanel");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.event.TableValueChangeEvent;
|
||||
import org.adempiere.webui.event.TableValueChangeListener;
|
||||
|
@ -194,6 +195,10 @@ public class WListItemRenderer implements ListitemRenderer<Object>, EventListene
|
|||
int rowIndex, int columnIndex)
|
||||
{
|
||||
ListCell listcell = new ListCell();
|
||||
WTableColumn column = getColumn(columnIndex);
|
||||
if (column != null && column.getHeaderValue() != null) {
|
||||
listcell.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, column.getHeaderValue().toString());
|
||||
}
|
||||
boolean isCellEditable = table != null ? table.isCellEditable(rowIndex, columnIndex) : false;
|
||||
|
||||
// TODO put this in factory method for generating cell renderers, which
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.sql.PreparedStatement;
|
|||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.component.Checkbox;
|
||||
import org.adempiere.webui.component.Grid;
|
||||
|
@ -175,16 +176,22 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener<Event>
|
|||
|
||||
fieldValue = new Textbox();
|
||||
fieldValue.setMaxlength(40);
|
||||
fieldValue.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "value");
|
||||
fieldName = new Textbox();
|
||||
fieldName.setMaxlength(40);
|
||||
fieldName.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "name");
|
||||
fieldContact = new Textbox();
|
||||
fieldContact.setMaxlength(40);
|
||||
fieldContact.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "contact");
|
||||
fieldEMail = new Textbox();
|
||||
fieldEMail.setMaxlength(40);
|
||||
fieldEMail.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "email");
|
||||
fieldPostal = new Textbox();
|
||||
fieldPostal.setMaxlength(40);
|
||||
fieldPhone = new Textbox();
|
||||
fieldPostal.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "postal");
|
||||
fieldPhone = new Textbox();
|
||||
fieldPhone.setMaxlength(40);
|
||||
fieldPhone.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "phone");
|
||||
|
||||
checkAND = new Checkbox();
|
||||
checkAND.setLabel(Msg.getMsg(Env.getCtx(), "SearchAND"));
|
||||
|
@ -210,6 +217,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener<Event>
|
|||
fieldPostal.setHflex("1");
|
||||
|
||||
Grid grid = GridFactory.newGridLayout();
|
||||
grid.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "infoParameterPanel");
|
||||
|
||||
Rows rows = new Rows();
|
||||
grid.appendChild(rows);
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.sql.Timestamp;
|
|||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.component.Grid;
|
||||
import org.adempiere.webui.component.GridFactory;
|
||||
import org.adempiere.webui.component.Label;
|
||||
|
@ -189,6 +190,11 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener<Event>
|
|||
txt2 = new Textbox();
|
||||
txt3 = new Textbox();
|
||||
txt4 = new Textbox();
|
||||
|
||||
txt1.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "textbox1");
|
||||
txt2.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "textbox2");
|
||||
txt3.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "textbox3");
|
||||
txt4.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "textbox4");
|
||||
|
||||
lbl1 = new Label();
|
||||
lbl2 = new Label();
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.sql.SQLException;
|
|||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.component.Checkbox;
|
||||
import org.adempiere.webui.component.Datebox;
|
||||
|
@ -174,6 +175,12 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev
|
|||
fDocumentNo.addEventListener(Events.ON_CHANGE, this);
|
||||
fDescription.addEventListener(Events.ON_CHANGE, this);
|
||||
fPOReference.addEventListener(Events.ON_CHANGE, this);
|
||||
|
||||
fDocumentNo.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "documentNo");
|
||||
fDescription.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "description");
|
||||
fPOReference.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "poreference");
|
||||
fDateFrom.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "dateFrom");
|
||||
fDateTo.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "dateTo");
|
||||
|
||||
fIsSOTrx.setLabel(Msg.translate(Env.getCtx(), "IsSOTrx"));
|
||||
fIsSOTrx.setChecked(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx")));
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.sql.SQLException;
|
|||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.component.Checkbox;
|
||||
import org.adempiere.webui.component.Datebox;
|
||||
|
@ -170,12 +171,21 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener
|
|||
|
||||
txtDocumentNo = new Textbox();
|
||||
txtDescription = new Textbox();
|
||||
|
||||
txtDocumentNo.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "documentNo");
|
||||
txtDescription.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "description");
|
||||
|
||||
dateFrom = new Datebox();
|
||||
dateTo= new Datebox();
|
||||
|
||||
dateFrom.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "dateFrom");
|
||||
dateTo.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "dateTo");
|
||||
|
||||
amountFrom = new NumberBox(false);
|
||||
amountTo = new NumberBox(false);
|
||||
|
||||
amountFrom.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "amountFrom");
|
||||
amountTo.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "amountTo");
|
||||
|
||||
isPaid = new Checkbox();
|
||||
isPaid.setLabel(Msg.translate(Env.getCtx(), "IsPaid"));
|
||||
|
@ -189,6 +199,7 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener
|
|||
Env.getCtx(), "C_BPartner_ID"), "", false, false, true);
|
||||
editorBPartner.addValueChangeListener(this);
|
||||
editorBPartner.getComponent().setHflex("1");
|
||||
editorBPartner.getComponent().setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "bpartnerLookup");
|
||||
|
||||
MLookup lookupOrder = MLookupFactory.get(Env.getCtx(), p_WindowNo,
|
||||
0, 4247, DisplayType.Search);
|
||||
|
@ -196,6 +207,7 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener
|
|||
Env.getCtx(), "C_Order_ID"), "", false, false, true);
|
||||
editorOrder.addValueChangeListener(this);
|
||||
editorOrder.getComponent().setHflex("1");
|
||||
editorOrder.getComponent().setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "orderLookup");
|
||||
}
|
||||
|
||||
private void init()
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.sql.SQLException;
|
|||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.component.Checkbox;
|
||||
import org.adempiere.webui.component.Datebox;
|
||||
|
@ -158,11 +159,21 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener
|
|||
txtDescription = new Textbox();
|
||||
txtOrderRef = new Textbox();
|
||||
|
||||
txtDocumentNo.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "documentNo");
|
||||
txtDescription.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "description");
|
||||
txtOrderRef.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "orderReference");
|
||||
|
||||
dateFrom = new Datebox();
|
||||
dateTo= new Datebox();
|
||||
|
||||
dateFrom.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "dateFrom");
|
||||
dateTo.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "dateTo");
|
||||
|
||||
amountFrom = new NumberBox(false);
|
||||
amountTo = new NumberBox(false);
|
||||
|
||||
amountFrom.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "amountFrom");
|
||||
amountTo.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "amountTo");
|
||||
|
||||
isSoTrx = new Checkbox();
|
||||
isSoTrx.setLabel(Msg.translate(Env.getCtx(), "IsSOTrx"));
|
||||
|
@ -172,6 +183,7 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener
|
|||
editorBPartner = new WSearchEditor(lookupBP, Msg.translate(
|
||||
Env.getCtx(), "C_BPartner_ID"), "", true, false, true);
|
||||
editorBPartner.addValueChangeListener(this);
|
||||
editorBPartner.getComponent().setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "bpartnerLookup");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import java.util.List;
|
|||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.apps.BusyDialog;
|
||||
import org.adempiere.webui.component.ConfirmPanel;
|
||||
|
@ -266,6 +267,8 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
scrollToSelectedRow();
|
||||
}
|
||||
});
|
||||
|
||||
setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "infopanel");
|
||||
} // InfoPanel
|
||||
|
||||
private void init()
|
||||
|
@ -311,6 +314,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
|
||||
contentPanel.setOddRowSclass(null);
|
||||
contentPanel.setSizedByContent(true);
|
||||
contentPanel.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "infoListbox");
|
||||
|
||||
this.setSclass("info-panel");
|
||||
} // init
|
||||
|
|
|
@ -42,6 +42,7 @@ import java.util.ArrayList;
|
|||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.component.Button;
|
||||
import org.adempiere.webui.component.ConfirmPanel;
|
||||
|
@ -266,15 +267,20 @@ public class InfoProductPanel extends InfoPanel implements EventListener<Event>
|
|||
m_InfoPAttributeButton.addEventListener(Events.ON_CLICK,this);
|
||||
|
||||
fieldValue = new Textbox();
|
||||
fieldValue.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "value");
|
||||
fieldName = new Textbox();
|
||||
fieldName.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "name");
|
||||
fieldUPC = new Textbox();
|
||||
fieldUPC.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "upc");
|
||||
fieldSKU = new Textbox();
|
||||
fieldSKU.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "sku");
|
||||
pickPriceList = new Listbox();
|
||||
pickPriceList.setRows(0);
|
||||
pickPriceList.setMultiple(false);
|
||||
pickPriceList.setMold("select");
|
||||
pickPriceList.setHflex("1");
|
||||
pickPriceList.addEventListener(Events.ON_SELECT, this);
|
||||
pickPriceList.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "priceList");
|
||||
|
||||
// Elaine 2008/11/21
|
||||
pickProductCategory = new Listbox();
|
||||
|
@ -283,6 +289,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener<Event>
|
|||
pickProductCategory.setMold("select");
|
||||
pickProductCategory.setHflex("1");
|
||||
pickProductCategory.addEventListener(Events.ON_SELECT, this);
|
||||
pickProductCategory.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "productCategory");
|
||||
//
|
||||
pickAS = new Listbox();
|
||||
pickAS.setRows(0);
|
||||
|
@ -290,6 +297,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener<Event>
|
|||
pickAS.setMold("select");
|
||||
pickAS.setHflex("1");
|
||||
pickAS.addEventListener(Events.ON_SELECT, this);
|
||||
pickAS.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "attributeSet");
|
||||
|
||||
pickWarehouse = new Listbox();
|
||||
pickWarehouse.setRows(0);
|
||||
|
@ -297,6 +305,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener<Event>
|
|||
pickWarehouse.setMold("select");
|
||||
pickWarehouse.setHflex("1");
|
||||
pickWarehouse.addEventListener(Events.ON_SELECT, this);
|
||||
pickWarehouse.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "warehouse");
|
||||
|
||||
fieldVendor = new Textbox();
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.adempiere.webui.panel;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.LayoutUtils;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.component.Label;
|
||||
|
@ -88,6 +89,7 @@ public class StatusBarPanel extends Panel implements EventListener<Event>, IStat
|
|||
|
||||
private void init()
|
||||
{
|
||||
setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "statusBar");
|
||||
statusDB = new Label(" ");
|
||||
statusLine = new Label();
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ package org.adempiere.webui.panel;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.component.ConfirmPanel;
|
||||
import org.adempiere.webui.component.Grid;
|
||||
import org.adempiere.webui.component.GridFactory;
|
||||
|
@ -224,11 +225,9 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
|
|||
private void initComponents()
|
||||
{
|
||||
lblDocAction = new Label();
|
||||
lblDocAction.setId("lblDocAction");
|
||||
lblDocAction.setValue(Msg.translate(Env.getCtx(), "DocAction"));
|
||||
|
||||
label = new Label();
|
||||
label.setId("label");
|
||||
|
||||
lstDocAction = new Listbox();
|
||||
lstDocAction.setId("lstDocAction");
|
||||
|
@ -245,8 +244,8 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
|
|||
private void init()
|
||||
{
|
||||
|
||||
setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "documentAction");
|
||||
Grid grid = GridFactory.newGridLayout();
|
||||
grid.setId("grd");
|
||||
grid.setStyle("width: 390px; margin: auto;");
|
||||
|
||||
Rows rows = new Rows();
|
||||
|
|
|
@ -18,6 +18,11 @@ public class Widget extends By {
|
|||
this.locator = locator;
|
||||
}
|
||||
|
||||
public Widget(WebElement element) {
|
||||
String id = element.getAttribute("id");
|
||||
locator = "#"+id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WebElement> findElements(SearchContext context) {
|
||||
List<WebElement> list = new ArrayList<WebElement>();
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.junit.After;
|
|||
import org.junit.Before;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.JavascriptExecutor;
|
||||
import org.openqa.selenium.Keys;
|
||||
import org.openqa.selenium.NoSuchElementException;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
@ -38,22 +37,33 @@ public class AbstractTestCase {
|
|||
element.sendKeys(value);
|
||||
}
|
||||
|
||||
protected void select(String locator, String label) {
|
||||
WebElement select = driver.findElement(Zk.jq(locator));
|
||||
select(select, label);
|
||||
protected void comboboxSelectItem(String locator, String label) {
|
||||
Widget widget = new Widget(locator);
|
||||
widget.execute(driver, "setValue('"+label+"')");
|
||||
widget.execute(driver, "fireOnChange()");
|
||||
WebElement element = widget.$n(driver, "real");
|
||||
element.click();
|
||||
}
|
||||
|
||||
protected void select(WebElement select, String label) {
|
||||
WebElement element = select.findElement(By.tagName("input"));
|
||||
element.clear();
|
||||
element.sendKeys(label);
|
||||
waitResponse();
|
||||
protected void comboboxSelectItem(WebElement select, String label) {
|
||||
Widget widget = new Widget(select);
|
||||
widget.execute(driver, "setValue('"+label+"')");
|
||||
widget.execute(driver, "fireOnChange()");
|
||||
WebElement element = widget.$n(driver, "real");
|
||||
element.click();
|
||||
element.sendKeys(Keys.TAB);
|
||||
}
|
||||
|
||||
protected void clickCheckbox(String locator) {
|
||||
driver.findElement(Zk.jq("$"+locator+" ~ input")).click();
|
||||
protected void selectCheckbox(String locator, boolean select) {
|
||||
final WebElement element = driver.findElement(Zk.jq("$"+locator+" ~ input"));
|
||||
if (element.isSelected()) {
|
||||
if (!select) {
|
||||
element.click();
|
||||
}
|
||||
} else {
|
||||
if (select) {
|
||||
element.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void clickButton(String locator) {
|
||||
|
@ -136,10 +146,10 @@ public class AbstractTestCase {
|
|||
type("$loginPanel $txtPassword", "GardenAdmin");
|
||||
|
||||
//select language
|
||||
select("$loginPanel $lstLanguage", "English");
|
||||
comboboxSelectItem("$loginPanel $lstLanguage", "English");
|
||||
|
||||
// check select role
|
||||
clickCheckbox("$loginPanel $chkSelectRole");
|
||||
selectCheckbox("$loginPanel $chkSelectRole", true);
|
||||
// click ok button
|
||||
clickButton("$loginPanel $Ok");
|
||||
|
||||
|
@ -173,14 +183,14 @@ public class AbstractTestCase {
|
|||
|
||||
// select client
|
||||
if (lstClient != null && lstClient.isDisplayed()) {
|
||||
select(lstClient, client);
|
||||
comboboxSelectItem(lstClient, client);
|
||||
}
|
||||
|
||||
// select role
|
||||
select("$rolePanel $lstRole", role);
|
||||
comboboxSelectItem("$rolePanel $lstRole", role);
|
||||
|
||||
// select organization
|
||||
select("$rolePanel $lstOrganisation", org);
|
||||
comboboxSelectItem("$rolePanel $lstOrganisation", org);
|
||||
|
||||
// click ok button
|
||||
clickButton("$rolePanel $Ok");
|
||||
|
|
|
@ -2,7 +2,9 @@ package test;
|
|||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.idempiere.ui.zk.selenium.Zk;
|
||||
import org.junit.*;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
/**
|
||||
* Web Driver + zk jq selector, doesn't required AdempiereIdGenerator
|
||||
|
@ -14,7 +16,7 @@ public class SelectTabTest extends AbstractTestCase {
|
|||
public void testSelectTab() throws Exception {
|
||||
login();
|
||||
waitResponse();
|
||||
select("$treeSearchCombo", "Product");
|
||||
comboboxSelectItem("$treeSearchCombo", "Product");
|
||||
waitResponse();
|
||||
clickButton("$findWindow_1 $simpleSearch $btnOk");
|
||||
waitResponse();
|
||||
|
@ -23,5 +25,8 @@ public class SelectTabTest extends AbstractTestCase {
|
|||
waitResponse();
|
||||
selectTab("$Product_1 $detailPane @tabbox", "Business Partner");
|
||||
assertEquals("Business Partner", selectedTab("$Product_1 $detailPane @tabbox"));
|
||||
|
||||
WebElement element = driver.findElement(Zk.jq("$Product_1 $Product @textbox[columnName=\"Name\"]"));
|
||||
assertNotNull(element);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue