use of org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException in project jbosstools-openshift by jbosstools.
the class ImportApplicationWizardGitTest method testNotExistingBranch.
@Test(expected = OpenshiftTestInFailureException.class)
public void testNotExistingBranch() {
Git repo = createRepo();
setRemote(repo, getOriginURL());
performCommit(repo);
renameMaster(repo);
service.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
ImportApplicationWizard importWizard = new ImportApplicationWizard();
assertProjectExistsErrorInWizard(importWizard);
GitCloningWizardPage gitCloningWizardPage = new GitCloningWizardPage();
gitCloningWizardPage.useExistingRepository(true);
try {
assertGitRemoteErrorInWizzard(importWizard);
} catch (AssertionError err) {
importWizard.cancel();
throw new OpenshiftTestInFailureException("https://issues.jboss.org/browse/JBIDE-24646", err);
}
importWizard.cancel();
}
use of org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException in project jbosstools-openshift by jbosstools.
the class OSExplorerResourceTest method testDeploymentConfigVisibleAfterServiceDeletion.
/**
* Test if deployment config is visible in OS Explorer, when there is no service.
*/
@Test(expected = OpenshiftTestInFailureException.class)
public void testDeploymentConfigVisibleAfterServiceDeletion() {
this.project.expand();
Service service = this.project.getService(OpenShiftResources.EAP_SERVICE);
assertTrue("Service does not exist!", service != null);
service.select();
new ContextMenuItem("Delete").select();
new DefaultShell("Delete OpenShift Resource");
new OkButton().click();
// assert service is deleted
List<OpenShiftResource> resources = this.project.getOpenShiftResources(Resource.SERVICE);
assertTrue("Service not deleted!", resources.isEmpty());
try {
this.project.getTreeItem().getItem("eap-app selector: deploymentConfig=eap-app");
} catch (CoreLayerException e) {
// TODO: do not throw after JBIDE-24217 is fixed
throw new OpenshiftTestInFailureException("JBIDE-24217");
// TODO: uncomment after JBIDE-24217 is fixed
// fail("Deployment config not visible!");
}
}
use of org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException in project jbosstools-openshift by jbosstools.
the class CreateApplicationOnBuilderImageTest method validateJBIDE22704.
private void validateJBIDE22704() {
BuilderImageApplicationWizardHandlingTest.nextToBuildConfigurationWizardPage();
applicationName = new LabeledText("Name: ").getText();
assertNotNull(applicationName);
assertTrue(applicationName.length() > 0);
String gitUrl = new LabeledText("Git Repository URL:").getText();
assertNotNull(gitUrl);
if (gitUrl.length() < 1) {
new CancelButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD));
throw new OpenshiftTestInFailureException("JBIDE-23704 should be fixed now.");
}
new WaitUntil(new ControlIsEnabled(new NextButton()));
/*
* switch to the Deployment page
*/
new NextButton().click();
new WaitUntil(new ControlIsEnabled(new BackButton()));
int numberofEnvironmentVariables = new DefaultTable().rowCount();
assertTrue(numberofEnvironmentVariables > 0);
/*
* switch to the Routing page
*/
new NextButton().click();
new WaitUntil(new ControlIsEnabled(new BackButton()));
int numberOfServicePorts = new DefaultTable().rowCount();
assertTrue(numberOfServicePorts > 0);
new CancelButton().click();
new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(120));
}
use of org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException 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.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException 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);
}
Aggregations