Search in sources :

Example 11 with DefaultText

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

the class NewApplicationWizardHandlingTest method testAccessibilityOfDefinedResourcesButton.

@Test(expected = OpenshiftTestInFailureException.class)
public void testAccessibilityOfDefinedResourcesButton() {
    new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
    assertDefinedResourcesButtonIsNotPresent();
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    assertDefinedResourcesButtonIsNotPresent();
    new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
    OpenShiftUtils.selectEAPTemplate();
    assertTrue("Defines Resources button should be enabled if a server template is selected.", new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    assertDefinedResourcesButtonIsNotPresent();
    new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
    new DefaultTree().unselectAllItems();
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    Display.syncExec(new Runnable() {

        @Override
        public void run() {
            new DefaultText(1).getSWTWidget().setText(DatastoreOS3.TEMPLATE_PATH);
        }
    });
    try {
        assertTrue("Defines Resources button should be enabled if a local template is selected.", new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
    } catch (CoreLayerException ex) {
        throw new OpenshiftTestInFailureException("Defined resources button was not found. Probable cause: JBIDE-24492", ex);
    }
    new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
    assertDefinedResourcesButtonIsNotPresent();
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OpenshiftTestInFailureException(org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) Test(org.junit.Test)

Example 12 with DefaultText

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

the class TemplateParametersTest method testModifyTemplateParameter.

@Test
public void testModifyTemplateParameter() {
    new DefaultTable().getItem(SOURCE_REPOSITORY_URL).select();
    new PushButton(OpenShiftLabel.Button.EDIT).click();
    new DefaultShell(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER);
    new DefaultText().setText(PERSONAL_GIT_REPO_URI);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER));
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    assertTrue("New value of git repo URI has not been modified successfully.", new DefaultTable().getItem(SOURCE_REPOSITORY_URL).getText(1).equals(PERSONAL_GIT_REPO_URI));
    new PushButton(OpenShiftLabel.Button.RESET).click();
    try {
        new WaitUntil(new TableContainsItem(new DefaultTable(), SOURCE_REPOSITORY_URL_VALUE, 1), TimePeriod.DEFAULT);
    } catch (WaitTimeoutExpiredException ex) {
        fail("Value for git repo URI has not been reset.");
    }
}
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) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) TableContainsItem(org.eclipse.reddeer.swt.condition.TableContainsItem) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Test(org.junit.Test)

Example 13 with DefaultText

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

the class NewApplicationWizardHandlingTest method testShowDefinedResourcesForLocalTemplate.

@Test(expected = OpenshiftTestInFailureException.class)
public void testShowDefinedResourcesForLocalTemplate() {
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    Display.syncExec(new Runnable() {

        @Override
        public void run() {
            new DefaultText(1).getSWTWidget().setText(DatastoreOS3.TEMPLATE_PATH);
        }
    });
    verifyDefinedResourcesForTemplate();
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) Test(org.junit.Test)

Example 14 with DefaultText

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

the class ProjectNameValidationTest method testInvalidProjectNameFormat.

@Test
public void testInvalidProjectNameFormat() {
    new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText("--");
    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 15 with DefaultText

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

the class ProjectNameValidationTest method testLongProjectName.

@Test
public void testLongProjectName() {
    new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText("0123456789" + "0123456789" + "0123456789" + "0123456789" + "0123456789" + "0123456789" + "0123456789" + "0123456789" + "0123456789" + "0123456789" + "0123456789" + "0123456789" + "01234");
    new DefaultText(PROJECT_NAME_MAX_LENGTH_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)

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