Search in sources :

Example 6 with DefaultTabItem

use of org.eclipse.reddeer.swt.impl.tab.DefaultTabItem in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method selectLocalTemplate.

private void selectLocalTemplate(final String templateLocalPath) {
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    new WaitWhile(new TreeIsAvailable());
    new LabeledText(OpenShiftLabel.TextLabels.SELECT_LOCAL_TEMPLATE).setText(templateLocalPath);
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) TreeIsAvailable(org.jboss.tools.openshift.reddeer.condition.TreeIsAvailable) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem)

Example 7 with DefaultTabItem

use of org.eclipse.reddeer.swt.impl.tab.DefaultTabItem 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 8 with DefaultTabItem

use of org.eclipse.reddeer.swt.impl.tab.DefaultTabItem in project jbosstools-openshift by jbosstools.

the class NewApplicationWizardHandlingTest method testShowDefinedResourcesForServerTemplate.

@Test
public void testShowDefinedResourcesForServerTemplate() {
    new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
    OpenShiftUtils.selectEAPTemplate();
    verifyDefinedResourcesForTemplate();
}
Also used : DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) Test(org.junit.Test)

Example 9 with DefaultTabItem

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

Aggregations

DefaultTabItem (org.eclipse.reddeer.swt.impl.tab.DefaultTabItem)9 Test (org.junit.Test)7 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)4 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)3 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)3 NewOpenShift3ApplicationWizard (org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard)3 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)3 TemplateParametersTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.TemplateParametersTest)3 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 DefaultText (org.eclipse.reddeer.swt.impl.text.DefaultText)2 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)2 TreeIsAvailable (org.jboss.tools.openshift.reddeer.condition.TreeIsAvailable)2 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)1 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)1 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)1 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)1 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1