use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.
the class WebPopupButton method createActionButton.
protected CubaButton createActionButton(Action action) {
CubaButton button = new CubaButton();
button.setWidth(100, Sizeable.Unit.PERCENTAGE);
button.setPrimaryStyleName(CONTEXT_MENU_BUTTON_STYLENAME);
setPopupButtonAction(button, action);
AppUI ui = AppUI.getCurrent();
if (ui != null) {
if (ui.isTestMode()) {
button.setCubaId(action.getId());
}
if (ui.isPerformanceTestMode()) {
String debugId = getDebugId();
if (debugId != null) {
TestIdManager testIdManager = ui.getTestIdManager();
button.setId(testIdManager.getTestId(debugId + "_" + action.getId()));
}
}
}
return button;
}
use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.
the class WebForm method assignDebugId.
protected void assignDebugId(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 com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.
the class WindowBreadCrumbs method componentAttachedToUI.
protected void componentAttachedToUI() {
adjustParentStyles();
if (ui.isTestMode()) {
linksLayout.setCubaId("breadCrumbs");
if (closeBtn != null) {
closeBtn.setCubaId("closeBtn");
}
}
if (ui.isPerformanceTestMode()) {
TestIdManager testIdManager = ui.getTestIdManager();
linksLayout.setId(testIdManager.getTestId("breadCrumbs"));
if (closeBtn != null) {
closeBtn.setId(testIdManager.getTestId("closeBtn"));
}
}
}
use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.
the class WebAbstractComponent 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));
}
}
use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.
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));
}
}
Aggregations