Search in sources :

Example 1 with DefaultText

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

the class EditConfigurationMainPage method setProject.

/**
 * Sets project for Hibernate Console Configuration
 * @param project given project name
 */
public void setProject(String project) {
    DefaultGroup g = new DefaultGroup("Project:");
    new DefaultText(g, 0).setText(project);
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) DefaultGroup(org.eclipse.reddeer.swt.impl.group.DefaultGroup)

Example 2 with DefaultText

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

the class NewApplicationWizardHandlingTest method testFilteringServerTemplates.

@Test
public void testFilteringServerTemplates() {
    DefaultText searchBar = new DefaultText(1);
    searchBar.setText("eap70-basic-s2i");
    assertTrue("There should be precisely one tree item in a tree.", new DefaultTree().getItems().size() == 1);
    String templateLabel = new DefaultTree().getItems().get(0).getText();
    assertTrue("There should be item representing basic EAP template in a tree but it is not there.", templateLabel.equals(OpenShiftLabel.Others.EAP_TEMPLATE) || templateLabel.equals(OpenShiftLabel.Others.EAP_TEMPLATE_OLD));
    searchBar.setText("");
    assertTrue("There should be more templates if search bar does not contain any search query", new DefaultTree().getItems().size() > 2);
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) Test(org.junit.Test)

Example 3 with DefaultText

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

the class ProjectNameValidationTest method testForbiddenCharactersInProjectName.

@Test
public void testForbiddenCharactersInProjectName() {
    new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText("AAA");
    new DefaultText(PROJECT_NAME_FORMAT_ERROR);
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 4 with DefaultText

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

the class ProjectNameValidationTest method testShortProjectName.

@Test
public void testShortProjectName() {
    new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText("s");
    new DefaultText(PROJECT_NAME_SHORT_ERROR);
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 5 with DefaultText

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

the class SecureStorage method provideSecureStoragePassword.

private static boolean provideSecureStoragePassword(String password) {
    try {
        new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD);
    } catch (CoreLayerException ex) {
        LOGGER.info(String.format("Shell with label \"%s\" was not found. Trying \"%s\"", OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD, OpenShiftLabel.Shell.SECURE_STORAGE));
        new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE);
    }
    new DefaultText(0).setText(password);
    boolean firstStorage = true;
    try {
        new DefaultText(1).setText(password);
    } catch (RedDeerException ex) {
        firstStorage = false;
    }
    new WaitUntil(new ControlIsEnabled(new OkButton()));
    new OkButton().click();
    return firstStorage;
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

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