use of io.jmix.ui.sys.TestIdManager in project jmix by jmix-framework.
the class TabSheetImpl method setDebugId.
@Override
public void setDebugId(@Nullable String id) {
super.setDebugId(id);
String debugId = getDebugId();
if (debugId != null && AppUI.getCurrent() != null) {
TestIdManager testIdManager = AppUI.getCurrent().getTestIdManager();
for (Map.Entry<com.vaadin.ui.Component, ComponentDescriptor> tabEntry : tabMapping.entrySet()) {
com.vaadin.ui.Component tabComponent = tabEntry.getKey();
com.vaadin.ui.TabSheet.Tab tab = component.getTab(tabComponent);
ComponentDescriptor componentDescriptor = tabEntry.getValue();
String name = componentDescriptor.name;
component.setTestId(tab, testIdManager.getTestId(debugId + "." + name));
}
}
}
use of io.jmix.ui.sys.TestIdManager in project jmix by jmix-framework.
the class ValuePickerImpl method addAction.
@Override
public void addAction(Action action, int index) {
checkNotNullArgument(action, "Action must be non null");
int oldIndex = findActionById(actions, action.getId());
if (oldIndex >= 0) {
removeAction(actions.get(oldIndex));
if (index > oldIndex) {
index--;
}
}
actions.add(index, action);
actionHandler.addAction(action, index);
JmixButton vButton = new JmixButton();
setupButtonAction(vButton, action);
action.addPropertyChangeListener(actionPropertyChangeListener);
component.addButton(vButton, index);
actionButtons.put(action, vButton);
if (StringUtils.isNotEmpty(getDebugId()) && AppUI.getCurrent() != null) {
TestIdManager testIdManager = AppUI.getCurrent().getTestIdManager();
// Set debug id
vButton.setId(testIdManager.getTestId(getDebugId() + "_" + action.getId()));
}
if (action instanceof ValuePickerAction) {
ValuePickerAction pickerAction = (ValuePickerAction) action;
pickerAction.setPicker(this);
if (!isEditable()) {
pickerAction.editableChanged(isEditable());
}
}
actionsPermissions.apply(action);
refreshActionsState();
}
use of io.jmix.ui.sys.TestIdManager in project jmix by jmix-framework.
the class WebFieldGroup method assignDebugId.
protected void assignDebugId(FieldConfig fc, com.vaadin.ui.Component composition) {
AppUI ui = AppUI.getCurrent();
if (ui == null) {
return;
}
String debugId = getDebugId();
if (ui.isTestMode()) {
if (composition != null) {
composition.setJTestId(fc.getId());
}
}
if (ui.isPerformanceTestMode()) {
if (composition != null && debugId != null) {
TestIdManager testIdManager = ui.getTestIdManager();
composition.setId(testIdManager.getTestId(debugId + "_" + fc.getId()));
}
}
}
use of io.jmix.ui.sys.TestIdManager in project jmix by jmix-framework.
the class DateFieldImpl method setDebugId.
@Override
public void setDebugId(@Nullable String id) {
super.setDebugId(id);
if (id != null && AppUI.getCurrent() != null) {
TestIdManager testIdManager = AppUI.getCurrent().getTestIdManager();
timeField.setId(testIdManager.getTestId(id + "_time"));
dateField.setId(testIdManager.getTestId(id + "_date"));
}
}
use of io.jmix.ui.sys.TestIdManager in project jmix by jmix-framework.
the class PopupButtonImpl method setDebugId.
@Override
public void setDebugId(@Nullable String id) {
super.setDebugId(id);
AppUI ui = AppUI.getCurrent();
if (id != null && ui != null && ui.isPerformanceTestMode()) {
TestIdManager testIdManager = ui.getTestIdManager();
for (Map.Entry<Action, Button> entry : actionButtons.entrySet()) {
Button button = entry.getValue();
Action action = entry.getKey();
button.setId(testIdManager.getTestId(id + "_" + action.getId()));
}
}
}
Aggregations