use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class CreateNewProjectTest method testCreateNewProjectViaContextMenu.
@Test
public void testCreateNewProjectViaContextMenu() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
try {
connection.createNewProject2();
} catch (RedDeerException ex) {
fail("OpenShift project created for a connection has not been shown in OpenShift explorer.\n" + ex.getMessage());
}
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class LinkToCreateNewProjectTest method createOpenShiftProjectViaLinkInExplorer.
@Test
public void createOpenShiftProjectViaLinkInExplorer() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
OpenShiftUtils.deleteAllProjects(connectionReq.getConnection());
TreeItem connectionItem = explorer.getOpenShift3Connection(connectionReq.getConnection()).getTreeItem();
TreeItem newProjectLinkItem = null;
try {
newProjectLinkItem = connectionItem.getItem("No projects are available. Click here to create a new project...");
} catch (RedDeerException ex) {
fail("There is no link to create a new project even connection does not have any project.");
}
TreeItemHandler.getInstance().click(newProjectLinkItem.getSWTWidget());
try {
new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
} catch (RedDeerException ex) {
fail("Create new OpenShift project shell has not been opened.");
}
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(projectName);
new WaitUntil(new ControlIsEnabled(new FinishButton()));
new FinishButton().click();
projectCreated = true;
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
assertTrue("OpenShift project is not visible in OpenShift Explorer under the connection" + " although it should have been created successfully and visible.", explorer.getOpenShift3Connection(connectionReq.getConnection()).projectExists(projectName));
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class ResourcesTest method verifyResourceExistence.
private void verifyResourceExistence(TreeItem projectItem, Resource resource) {
try {
OpenShiftProject project = new OpenShiftProject(projectItem);
project.select();
project.openProperties();
project.selectTabbedProperty(resource.toString());
} catch (RedDeerException ex) {
fail("Resource " + resource.toString() + " does not exist under a specified project item.");
}
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class SecureStorage method provideSecureStoragePassword.
private static boolean provideSecureStoragePassword(String password) {
try {
new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD);
} catch (CoreLayerException ex) {
LOGGER.info(String.format("Shell with label \"%s\" was not found. Trying \"%s\"", OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD, OpenShiftLabel.Shell.SECURE_STORAGE));
new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE);
}
new DefaultText(0).setText(password);
boolean firstStorage = true;
try {
new DefaultText(1).setText(password);
} catch (RedDeerException ex) {
firstStorage = false;
}
new WaitUntil(new ControlIsEnabled(new OkButton()));
new OkButton().click();
return firstStorage;
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.
the class TestUtils method acceptSSLCertificate.
public static void acceptSSLCertificate() {
try {
new DefaultShell(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE);
new YesButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE));
} catch (RedDeerException ex) {
// no dialog was presented
}
}
Aggregations