Search in sources :

Example 6 with ControlIsEnabled

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);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OpenShiftProject(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftProject) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test) BuilderImageApplicationWizardHandlingTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.BuilderImageApplicationWizardHandlingTest)

Example 7 with ControlIsEnabled

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();
}
Also used : NewCDK32ServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK32ServerWizardPage) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 8 with ControlIsEnabled

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);
}
Also used : NewMinishiftServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewMinishiftServerWizardPage) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 9 with ControlIsEnabled

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);
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 10 with ControlIsEnabled

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();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) InternalBrowser(org.eclipse.reddeer.swt.impl.browser.InternalBrowser) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Test(org.junit.Test)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)54 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)54 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)31 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)25 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)25 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)24 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)19 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)18 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)17 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)17 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)14 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)14 Test (org.junit.Test)13 NewCDKServerWizard (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard)9 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)8 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)8 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)7 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)6 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6