use of io.jmix.ui.sys.TestIdManager in project jmix by jmix-framework.
the class TablePresentationsLayout method createActionButton.
protected JmixButton createActionButton(Action action) {
JmixButton actionBtn = new JmixButton();
actionBtn.setWidth("100%");
actionBtn.setPrimaryStyleName(CONTEXT_MENU_BUTTON_STYLENAME);
setPopupButtonAction(actionBtn, action);
AppUI ui = AppUI.getCurrent();
if (ui != null) {
if (ui.isTestMode()) {
actionBtn.setJTestId(action.getId());
}
if (ui.isPerformanceTestMode()) {
String debugId = getDebugId();
if (debugId != null) {
TestIdManager testIdManager = ui.getTestIdManager();
actionBtn.setId(testIdManager.getTestId(debugId + "_" + action.getId()));
}
}
}
return actionBtn;
}
use of io.jmix.ui.sys.TestIdManager in project jmix by jmix-framework.
the class CompositeComponent method assignDebugId.
protected void assignDebugId() {
AppUI ui = AppUI.getCurrent();
if (ui == null) {
return;
}
if (root == null || frame == null || StringUtils.isEmpty(frame.getId())) {
return;
}
if (ui.isPerformanceTestMode() && getDebugId() == null) {
String fullFrameId = ComponentsHelper.getFullFrameId(frame);
TestIdManager testIdManager = ui.getTestIdManager();
String alternativeId = id != null ? id : getClass().getSimpleName();
String candidateId = fullFrameId + "." + alternativeId;
setDebugId(testIdManager.getTestId(candidateId));
}
}
use of io.jmix.ui.sys.TestIdManager in project jmix by jmix-framework.
the class FormImpl method assignDebugId.
protected void assignDebugId(@Nullable com.vaadin.ui.Component composition, String id) {
AppUI ui = AppUI.getCurrent();
if (ui == null) {
return;
}
String debugId = getDebugId();
if (ui.isPerformanceTestMode()) {
if (composition != null && debugId != null) {
TestIdManager testIdManager = ui.getTestIdManager();
composition.setId(testIdManager.getTestId(debugId + "_" + id));
}
}
}
use of io.jmix.ui.sys.TestIdManager in project jmix by jmix-framework.
the class AccordionImpl method setDebugId.
@Override
public void setDebugId(@Nullable String id) {
super.setDebugId(id);
String debugId = getDebugId();
AppUI ui = AppUI.getCurrent();
if (debugId != null && ui != null) {
TestIdManager testIdManager = ui.getTestIdManager();
for (Map.Entry<com.vaadin.ui.Component, ComponentDescriptor> tabEntry : tabMapping.entrySet()) {
com.vaadin.ui.Component tabComponent = tabEntry.getKey();
com.vaadin.ui.Accordion.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 AbstractComponent method assignDebugId.
protected void assignDebugId() {
AppUI ui = AppUI.getCurrent();
if (ui == null) {
return;
}
if (this.component == null || frame == null || StringUtils.isEmpty(frame.getId())) {
return;
}
if (ui.isPerformanceTestMode() && getDebugId() == null) {
String fullFrameId = ComponentsHelper.getFullFrameId(frame);
TestIdManager testIdManager = ui.getTestIdManager();
String alternativeId = id != null ? id : getClass().getSimpleName();
String candidateId = fullFrameId + "." + alternativeId;
setDebugId(testIdManager.getTestId(candidateId));
}
}
Aggregations