use of org.eclipse.reddeer.core.exception.CoreLayerException 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();
}
use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.
the class NewApplicationWizardHandlingTest method verifyDefinedResourcesForTemplate.
private void verifyDefinedResourcesForTemplate() {
try {
new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES)), TimePeriod.DEFAULT);
} catch (WaitTimeoutExpiredException ex) {
fail("Defined Resources button is not enabled");
} catch (CoreLayerException ex) {
// Defined resources button was not found
throw new OpenshiftTestInFailureException("Defined resources button was not found. Probable cause: JBIDE-24492", ex);
}
new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).click();
new DefaultShell(OpenShiftLabel.Shell.TEMPLATE_DETAILS);
List<TreeItem> items = new DefaultTree().getItems();
assertTrue("There should be build config item in tree describing resources", items.get(0).getText().contains("BuildConfig"));
assertTrue("There should be deployment config item in tree describing resources", items.get(1).getText().contains("DeploymentConfig"));
assertTrue("There should be image stream item in tree describing resources", items.get(2).getText().contains("ImageStream"));
assertTrue("There should be route item in tree describing resources", items.get(3).getText().contains("Route"));
assertTrue("There should be service item in tree describing resources", items.get(4).getText().contains("Service"));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.TEMPLATE_DETAILS), TimePeriod.DEFAULT);
}
use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.
the class ProjectPropertiesTest method getCurrentAnnotationProperties.
private List<TreeItem> getCurrentAnnotationProperties() {
try {
PropertySheetProperty annotationPropertiesRoot = propertiesView.getProperty("Annotations");
List<TreeItem> annotationProperties = annotationPropertiesRoot.getTreeItem().getItems();
assertTrue("There should be some annotation properties in the tab", annotationProperties != null && annotationProperties.size() > 0);
return annotationProperties;
} catch (CoreLayerException e) {
fail(e.getMessage());
return null;
}
}
use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.
the class StoreConnectionTest method secureStorageDisabledJBIDE19604Test.
@Test
public void secureStorageDisabledJBIDE19604Test() {
deleteSecureStorage();
invokeNewAppWizardFromCentral();
new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).toggle(true);
new NextButton().click();
// Cancel secure storage shell
try {
new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD);
} catch (CoreLayerException ex) {
new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE);
}
new CancelButton().click();
// Cancel warning shell
new DefaultShell("Warning");
new OkButton().click();
new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).toggle(false);
// Next button should work
new NextButton().click();
AbstractWaitCondition backButtonIsEnabled = new AbstractWaitCondition() {
@Override
public boolean test() {
return new BackButton().isEnabled();
}
};
new WaitUntil(backButtonIsEnabled);
new CancelButton().click();
}
use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.
the class ShellWithButton method lookForShellWithButton.
private static org.eclipse.swt.widgets.Shell lookForShellWithButton(final String title, final String buttonLabel) {
Matcher<String> titleMatcher = new WithTextMatcher(title);
Matcher<String> buttonMatcher = new BaseMatcher<String>() {
@Override
public boolean matches(Object obj) {
if (obj instanceof Control) {
final Control control = (Control) obj;
ReferencedComposite ref = new ReferencedComposite() {
@Override
public Control getControl() {
return control;
}
};
try {
new PushButton(ref, buttonLabel);
return true;
} catch (CoreLayerException e) {
// ok, this control doesn't contain the button
}
}
return false;
}
@Override
public void describeTo(Description description) {
description.appendText("containing button '" + buttonLabel + "'");
}
};
@SuppressWarnings("unchecked") Matcher<String> matcher = new AndMatcher(titleMatcher, buttonMatcher);
return ShellLookup.getInstance().getShell(matcher);
}
Aggregations