use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method findOpenShiftConnection.
/**
* Finds OpenShift 3 connection based on server username parameters
*
* @param server server name
* @param username connection username
* @return openshift 3 connection object if found
*/
public OpenShift3Connection findOpenShiftConnection(String server, String username) {
OpenShiftExplorerView osExplorer = new OpenShiftExplorerView();
osExplorer.open();
if (osExplorer.connectionExists(server, username)) {
return osExplorer.getOpenShift3Connection(server, username);
} else {
throw new OpenShiftToolsException("Could not find OpenShift connection for " + server + " and " + // $NON-NLS-1$;
username);
}
}
use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.
the class OpenNewApplicationWizardWithNoProjectTest method deleteTmpProject.
@After
public void deleteTmpProject() {
OpenShift3Connection connection = new OpenShiftExplorerView().getOpenShift3Connection(connectionReq.getConnection());
connection.refresh();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
if (connection.projectExists(projectName)) {
connection.getProject(projectName).delete();
}
// Delete connection too
new OpenShiftExplorerView().getOpenShift3Connection(connectionReq.getConnection()).remove();
}
use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.
the class OpenNewApplicationWizardWithNoProjectTest method testOpenNewApplicationWizardFromOpenShiftExplorerWithNoProjects.
@Test
public void testOpenNewApplicationWizardFromOpenShiftExplorerWithNoProjects() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
connection.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_OS3_APPLICATION).select();
try {
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
} catch (WaitTimeoutExpiredException ex) {
fail("Shell to create a new OpenShift application was supposed to be opened. But it's not.");
}
new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(projectName);
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
new WaitWhile(new JobIsRunning());
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
assertTrue("Created project was not preselected for a new OpenShift application. Could be failing because " + "of https://issues.jboss.org/browse/JBIDE-21593.", new LabeledCombo(OpenShiftLabel.TextLabels.PROJECT).getSelection().equals(projectName));
closeWizard();
}
use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.
the class OpenNewApplicationWizardWithNoProjectTest method createProjects.
@AfterClass
public static void createProjects() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.open();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
connection.createNewProject();
connection.createNewProject2();
}
use of org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView in project jbosstools-openshift by jbosstools.
the class OpenNewApplicationWizardWithNoProjectTest method testOpenNewApplicationWizardFromOpenShiftExplorerWithNoProjectsAndCancelNewProject.
@Test
public void testOpenNewApplicationWizardFromOpenShiftExplorerWithNoProjectsAndCancelNewProject() {
clearLog();
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
connection.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_OS3_APPLICATION).select();
;
try {
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
} catch (WaitTimeoutExpiredException ex) {
fail("Shell to create a new OpenShift application was supposed to be opened. But it's not.");
}
new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(projectName);
new CancelButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
// do not click! New App wizard should close on canceling New Project wizard.
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
checkErrorLog();
clearLog();
}
Aggregations