Search in sources :

Example 1 with Text

use of org.eclipse.reddeer.swt.api.Text in project jbosstools-openshift by jbosstools.

the class EditResourceLimitsTest method incrementLimits.

private void incrementLimits(int index, String defaultSuffix) {
    new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_RESOURCE_LIMITS).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_RESOURCE_LIMITS));
    new DefaultShell(OpenShiftLabel.Shell.EDIT_RESOURCE_LIMITS).setFocus();
    Text text = new DefaultText(index);
    String value = text.getText();
    long val = 0L;
    try {
        val = Long.parseLong(value);
    } catch (NumberFormatException e) {
    }
    text.setText(Long.toString(++val));
    Combo combo = new DefaultCombo(index);
    value = combo.getSelection();
    if (StringUtils.isEmpty(value)) {
        combo.setSelection(defaultSuffix);
    }
    new WaitUntil(new ControlIsEnabled(new OkButton()));
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) Text(org.eclipse.reddeer.swt.api.Text) DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) Combo(org.eclipse.reddeer.swt.api.Combo) DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 Combo (org.eclipse.reddeer.swt.api.Combo)1 Text (org.eclipse.reddeer.swt.api.Text)1 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)1 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)1 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)1 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)1 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 DefaultText (org.eclipse.reddeer.swt.impl.text.DefaultText)1