use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class CreateApplicationOnBuilderImageTest method testCreateApplicationBasedOnBuilderImage.
@Test
public void testCreateApplicationBasedOnBuilderImage() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer();
BuilderImageApplicationWizardHandlingTest.nextToBuildConfigurationWizardPage();
applicationName = new LabeledText("Name: ").getText();
new WaitUntil(new ControlIsEnabled(new FinishButton()));
new FinishButton().click();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY));
CreateApplicationFromTemplateTest.importApplicationAndVerify(projectName);
OpenShiftProject project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject();
project.refresh();
new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(120));
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD_CONFIG, connectionReq.getConnection()), TimePeriod.LONG, false);
List<OpenShiftResource> buildConfig = project.getOpenShiftResources(Resource.BUILD_CONFIG);
assertTrue("There should be precisely 1 build config for created application, but there is following amount" + " of build configs: " + buildConfig.size(), buildConfig.size() == 1);
List<OpenShiftResource> imageStream = project.getOpenShiftResources(Resource.IMAGE_STREAM);
assertTrue("There should be precisely 1 image stream for created application, but there is following amount" + " of image streams: " + imageStream.size(), imageStream.size() == 1);
List<OpenShiftResource> routes = project.getOpenShiftResources(Resource.ROUTE);
assertTrue("There should be precisely 1 route for created application, but there is following amount" + " of routes:" + routes.size(), routes.size() == 1);
assertTrue("Generated (default) route should contain application name, but it's not contained.", routes.get(0).getName().equals(applicationName));
List<OpenShiftResource> services = project.getOpenShiftResources(Resource.SERVICE);
assertTrue("There should be precisely 1 service for created application, but there is following amount" + " of services: " + services.size(), services.size() == 1);
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled 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.condition.ControlIsEnabled 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.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class BuilderImageApplicationWizardHandlingTest method nextToBuildConfigurationWizardPage.
/**
************
* NAVIGATATION
**************
*/
public static void nextToBuildConfigurationWizardPage() {
// List<TreeItem> templates = new DefaultTree().getAllItems();
// for (TreeItem item : templates) {
// if (item.getText().contains(BUILDER_IMAGE)) {
// item.select();
// break;
// }
// }
new DefaultTreeItem(BUILDER_IMAGE).select();
new WaitUntil(new ControlIsEnabled(new NextButton()));
new NextButton().click();
new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled 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();
}
Aggregations