Search in sources :

Example 6 with DefaultText

use of org.eclipse.reddeer.swt.impl.text.DefaultText in project linuxtools by eclipse.

the class DockerImagesTab method searchImage.

public void searchImage(String searchText) {
    this.activate();
    new DefaultText().setText(searchText);
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText)

Example 7 with DefaultText

use of org.eclipse.reddeer.swt.impl.text.DefaultText in project linuxtools by eclipse.

the class DockerContainersTab method searchContainer.

public void searchContainer(String containerName) {
    this.activate();
    new DefaultText().setText(containerName);
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText)

Example 8 with DefaultText

use of org.eclipse.reddeer.swt.impl.text.DefaultText 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)

Example 9 with DefaultText

use of org.eclipse.reddeer.swt.impl.text.DefaultText in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromTemplateTest method completeWizardAndVerify.

private void completeWizardAndVerify() {
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    String srcRepoRef = new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_REF).getText(1);
    srcRepoURI = new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_URL).getText(1);
    String contextDir = new DefaultTable().getItem(TemplateParametersTest.CONTEXT_DIR).getText(1);
    applicationName = new DefaultTable().getItem(TemplateParametersTest.APPLICATION_NAME).getText(1);
    new NextButton().click();
    new WaitWhile(new ControlIsEnabled(new NextButton()), TimePeriod.LONG);
    new FinishButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    assertTrue(TemplateParametersTest.SOURCE_REPOSITORY_REF + " is not same as the one shown in " + "New OpenShift Application wizard.", new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_REF).getText(1).equals(srcRepoRef));
    assertTrue(TemplateParametersTest.SOURCE_REPOSITORY_URL.split(" ")[0] + " is not same as the one shown in " + "New OpenShift Application wizard.", new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_URL.split(" ")[0]).getText(1).equals(srcRepoURI));
    assertTrue(TemplateParametersTest.CONTEXT_DIR + " is not same as the one shown in New OpenShift" + " Application wizard.", new DefaultTable().getItem(TemplateParametersTest.CONTEXT_DIR).getText(1).equals(contextDir));
    assertTrue(TemplateParametersTest.APPLICATION_NAME.split(" ")[0] + " is not same as the one shown in " + "New OpenShift Application wizard.", new DefaultTable().getItem(TemplateParametersTest.APPLICATION_NAME.split(" ")[0]).getText(1).equals(applicationName));
    assertFalse(TemplateParametersTest.GENERIC_SECRET.split(" ")[0] + " should be generated and non-empty.", new DefaultTable().getItem(TemplateParametersTest.GENERIC_SECRET.split(" ")[0]).getText(1).isEmpty());
    assertFalse(TemplateParametersTest.GITHUB_SECRET.split(" ")[0] + " should be generated and non-empty.", new DefaultTable().getItem(TemplateParametersTest.GITHUB_SECRET.split(" ")[0]).getText(1).isEmpty());
    new DefaultLink("Click here to display the webhooks available to automatically trigger builds.").click();
    new DefaultShell(OpenShiftLabel.Shell.WEBHOOK_TRIGGERS);
    genericWebhookURL = new DefaultText(0).getText();
    githubWebhookURL = new DefaultText(1).getText();
    assertFalse("Generic webhook URL should not be empty.", genericWebhookURL.isEmpty());
    assertFalse("GitHub webhook URL should not be empty.", githubWebhookURL.isEmpty());
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.WEBHOOK_TRIGGERS));
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultLink(org.eclipse.reddeer.swt.impl.link.DefaultLink) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 10 with DefaultText

use of org.eclipse.reddeer.swt.impl.text.DefaultText in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method setTemplateParameters.

private void setTemplateParameters(TemplateParameter[] parameters) {
    for (TemplateParameter parameter : parameters) {
        new DefaultTable().select(parameter.getName());
        new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.EDIT)));
        new PushButton(OpenShiftLabel.Button.EDIT).click();
        new DefaultShell(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER);
        new DefaultText().setText(parameter.getValue());
        new WaitUntil(new ControlIsEnabled(new OkButton()));
        new OkButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER));
        new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    }
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

DefaultText (org.eclipse.reddeer.swt.impl.text.DefaultText)17 Test (org.junit.Test)9 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)6 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)5 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)5 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)5 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)5 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)5 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)4 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)4 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)3 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)3 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)2 DefaultGroup (org.eclipse.reddeer.swt.impl.group.DefaultGroup)2 DefaultTabItem (org.eclipse.reddeer.swt.impl.tab.DefaultTabItem)2 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)2 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)1 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 RunIf (org.eclipse.reddeer.junit.execution.annotation.RunIf)1 Combo (org.eclipse.reddeer.swt.api.Combo)1