Search in sources :

Example 1 with DefaultTabItem

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

the class CreateApplicationFromTemplateTest method createApplicationFromLocalWorkspaceTemplate.

@Test
public void createApplicationFromLocalWorkspaceTemplate() {
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer(DatastoreOS3.PROJECT1_DISPLAYED_NAME);
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    new PushButton(OpenShiftLabel.Button.BROWSE_WORKSPACE).click();
    new DefaultShell(OpenShiftLabel.Shell.SELECT_OPENSHIFT_TEMPLATE);
    new DefaultTreeItem(TESTS_PROJECT, "eap64-basic-s2i.json").select();
    new OkButton().click();
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    assertTrue("Template from workspace is not correctly shown in text field containing its path", new LabeledText(OpenShiftLabel.TextLabels.SELECT_LOCAL_TEMPLATE).getText().equals("${workspace_loc:" + File.separator + TESTS_PROJECT + File.separator + "eap64-basic-s2i.json}"));
    new WaitUntil(new ControlIsEnabled(new CancelButton()));
    // TODO: Remove comment once JBIDE-24492 is resolved
    // assertTrue("Defined resource button should be enabled",
    // new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
    completeApplicationCreationAndVerify(helloworldProject);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test) TemplateParametersTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.TemplateParametersTest)

Example 2 with DefaultTabItem

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

the class NewApplicationWizardHandlingTest method testTemplatesRelatedWidgetAccess.

@Test
public void testTemplatesRelatedWidgetAccess() {
    assertTrue("Server template selection should be chosen by default.", new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).isSelected());
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    try {
        new DefaultTree();
        fail("Tree with server templates should not be visible if local template " + "tab item is selected.");
    } catch (RedDeerException ex) {
    // pass
    }
    assertTrue("Browse button should be visible and enabled while local template " + "tab item is selected.", new PushButton(OpenShiftLabel.Button.BROWSE).isEnabled());
    new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
    assertTrue("Tree with server templates should be visible and enabled if server template " + "tab item is selected.", new DefaultTree().isEnabled());
    try {
        new PushButton(1, new WithTextMatcher(OpenShiftLabel.Button.BROWSE));
        fail("Browse button should not be visible while server template tab item is selected.");
    } catch (RedDeerException ex) {
    // pass
    }
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Test(org.junit.Test)

Example 3 with DefaultTabItem

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

the class CreateApplicationFromTemplateTest method createApplicationFromTemplateProvidedByURL.

@Test
public void createApplicationFromTemplateProvidedByURL() {
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer(DatastoreOS3.PROJECT1_DISPLAYED_NAME);
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    new LabeledText(OpenShiftLabel.TextLabels.SELECT_LOCAL_TEMPLATE).setText(URL);
    // TODO: Remove comment once JBIDE-24492 is resolved
    // assertTrue("Defined resource button should be enabled",
    // new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
    completeApplicationCreationAndVerify(helloworldProject);
}
Also used : LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test) TemplateParametersTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.TemplateParametersTest)

Example 4 with DefaultTabItem

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

the class CreateApplicationFromTemplateTest method createApplicationFromLocalFileSystemTemplate.

@Test
public void createApplicationFromLocalFileSystemTemplate() {
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer(DatastoreOS3.PROJECT1_DISPLAYED_NAME);
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    new LabeledText(OpenShiftLabel.TextLabels.SELECT_LOCAL_TEMPLATE).setText(TESTS_PROJECT_LOCATION + File.separator + "eap64-basic-s2i.json");
    // TODO: Remove comment once JBIDE-24492 is resolved
    // assertTrue("Defined resource button should be enabled",
    // new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
    completeApplicationCreationAndVerify(helloworldProject);
}
Also used : LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test) TemplateParametersTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.TemplateParametersTest)

Example 5 with DefaultTabItem

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

the class TemplatesCreator method selectServerTemplate.

private void selectServerTemplate(String templateName) {
    new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
    new WaitUntil(new TreeIsAvailable());
    new DefaultTree().selectItems(new DefaultTreeItem(templateName));
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) TreeIsAvailable(org.jboss.tools.openshift.reddeer.condition.TreeIsAvailable) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

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