use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method addNewCDK32Server.
/**
* Creates new CDK 3.2+ server adapter via ServersView -> New -> Server
*
* @param serverAdapter server adapter name
* @param hypervisor hypervisor to use
* @param path path to minishift binary file
* @param profile what profile to use
* @param username redhat developers username
* @param password user password
*/
public static void addNewCDK32Server(String serverAdapter, String hypervisor, String path, String profile, String username, String password) {
NewCDKServerWizard dialog = setupFirstNewServerWizardPage(CDK32_SERVER_NAME, serverAdapter);
// set second new server dialog page
NewCDK32ServerWizardPage containerPage = new NewCDK32ServerWizardPage();
containerPage.setCredentials(username, password);
if (hypervisor != null && !hypervisor.isEmpty()) {
// $NON-NLS-1$
log.info("Setting hypervisor to " + hypervisor);
containerPage.setHypervisor(hypervisor);
}
// $NON-NLS-1$
log.info("Setting minishift binary file folder to " + path);
containerPage.setMinishiftBinary(path);
if (!profile.isEmpty()) {
// $NON-NLS-1$
log.info("Setting minishift profile to " + profile);
containerPage.setMinishiftProfile(profile);
} else {
log.info("Keeping minishift profile default: " + containerPage.getMinishiftProfile());
}
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.DEFAULT);
// $NON-NLS-1$
log.info("Finishing Add new server dialog");
if (!(new FinishButton().isEnabled())) {
// $NON-NLS-1$
log.error("Finish button was not enabled");
}
dialog.finish();
}
use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method addNewMinishiftServer.
/**
* Creates new Minishift server adapter via ServersView -> New -> Server
*
* @param serverAdapter server adapter name
* @param hypervisor hypervisor to use
* @param path path to minishift binary file
* @param profile what profile to use
*/
public static void addNewMinishiftServer(String serverAdapter, String hypervisor, String path, String profile) {
NewCDKServerWizard dialog = setupFirstNewServerWizardPage(MINISHIFT_SERVER_NAME, serverAdapter);
// set second new server dialog page
NewMinishiftServerWizardPage containerPage = new NewMinishiftServerWizardPage();
if (!StringUtils.isEmptyOrNull(hypervisor)) {
// $NON-NLS-1$
log.info("Setting hypervisor to " + hypervisor);
containerPage.setHypervisor(hypervisor);
}
// $NON-NLS-1$
log.info("Setting minishift binary file folder to " + path);
containerPage.setMinishiftBinary(path);
// $NON-NLS-1$
log.info("Setting minishift profile to " + profile);
containerPage.setMinishiftProfile(profile);
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.DEFAULT);
// $NON-NLS-1$
log.info("Finishing Add new server dialog");
if (!(new FinishButton().isEnabled())) {
// $NON-NLS-1$
log.error("Finish button was not enabled");
}
dialog.finish(TimePeriod.MEDIUM);
}
use of org.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.
the class OpenNewApplicationWizardWithNoProjectTest method testOpenNewApplicationWizardFromCentralWithNoProjects.
@Test
public void testOpenNewApplicationWizardFromCentralWithNoProjects() {
new DefaultToolItem(new WorkbenchShell(), OpenShiftLabel.Others.RED_HAT_CENTRAL).click();
new InternalBrowser().execute(OpenShiftLabel.Others.OPENSHIFT_CENTRAL_SCRIPT);
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
for (String comboItem : new DefaultCombo(0).getItems()) {
if (comboItem.contains(connectionReq.getUsername()) && comboItem.contains(connectionReq.getHost())) {
new DefaultCombo(0).setSelection(comboItem);
break;
}
}
new NextButton().click();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
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(), TimePeriod.LONG);
new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
assertTrue("Created project was not preselected for a new OpenShift application", new LabeledCombo(OpenShiftLabel.TextLabels.PROJECT).getText().equals(projectName));
closeWizard();
}
use of org.eclipse.reddeer.swt.impl.button.FinishButton 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.eclipse.reddeer.swt.impl.button.FinishButton in project jbosstools-openshift by jbosstools.
the class OpenNewApplicationWizardWithNoProjectTest method testOpenNewApplicationWizardViaShellMenuWithNoProjects.
@Test
public void testOpenNewApplicationWizardViaShellMenuWithNoProjects() {
new WorkbenchShell().setFocus();
new ShellMenuItem("File", "New", "Other...").select();
new DefaultShell("New").setFocus();
new DefaultTreeItem("OpenShift", "OpenShift Application").select();
new NextButton().click();
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
for (String comboItem : new DefaultCombo(0).getItems()) {
if (comboItem.contains(connectionReq.getUsername()) && comboItem.contains(connectionReq.getHost())) {
new DefaultCombo(0).setSelection(comboItem);
break;
}
}
new NextButton().click();
TestUtils.acceptSSLCertificate();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
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(), TimePeriod.LONG);
new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
assertTrue("Created project was not preselected for a new OpenShift application", new LabeledCombo(OpenShiftLabel.TextLabels.PROJECT).getText().equals(projectName));
closeWizard();
}
Aggregations