Search in sources :

Example 41 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method createOpenShiftApplicationBasedOnTemplate.

private void createOpenShiftApplicationBasedOnTemplate(boolean importProject, boolean serverTemplate, String templateName, final String templateLocalPath, List<Label> labels, TemplateParameter... parameters) {
    if (serverTemplate) {
        selectServerTemplate(templateName);
    } else {
        selectLocalTemplate(templateLocalPath);
    }
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    if (parameters != null && parameters.length != 0) {
        setTemplateParameters(parameters);
    }
    new NextButton().click();
    new WaitWhile(new ControlIsEnabled(new NextButton()), TimePeriod.LONG);
    if (labels != null && labels.size() != 0) {
        createOpenShiftLabels(labels);
    }
    new FinishButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    new OkButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    executeImport(importProject);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 42 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method setTemplateParameters.

private void setTemplateParameters(TemplateParameter[] parameters) {
    for (TemplateParameter parameter : parameters) {
        new DefaultTable().select(parameter.getName());
        new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.EDIT)));
        new PushButton(OpenShiftLabel.Button.EDIT).click();
        new DefaultShell(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER);
        new DefaultText().setText(parameter.getValue());
        new WaitUntil(new ControlIsEnabled(new OkButton()));
        new OkButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER));
        new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    }
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 43 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method createOpenShiftLabels.

private void createOpenShiftLabels(List<Label> labels) {
    for (Label label : labels) {
        new PushButton(OpenShiftLabel.Button.ADD).click();
        new DefaultShell(OpenShiftLabel.Shell.RESOURCE_LABEL);
        new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText(label.getName());
        new LabeledText(OpenShiftLabel.TextLabels.VALUE).setText(label.getValue());
        new WaitUntil(new ControlIsEnabled(new OkButton()));
        new OkButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESOURCE_LABEL));
        new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    }
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) OpenShiftLabel(org.jboss.tools.openshift.reddeer.utils.OpenShiftLabel) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 44 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.

the class DeleteResourcesWizard method deleteResourceByName.

public void deleteResourceByName(String resourceName) {
    getResourceByName(resourceName).get(0).select();
    new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.DELETE)));
    delete();
}
Also used : ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 45 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.

the class CDKServerAdapterAbstractTest method addNewCDK3Server.

/**
 * Creates new CDK 3.x server adapter via ServersView -> New -> Server
 *
 * @param serverAdapter server adapter name
 * @param hypervisor hypervisor to use
 * @param path path to minishift binary file
 */
public static void addNewCDK3Server(String serverAdapter, String hypervisor, String path) {
    NewCDKServerWizard dialog = setupFirstNewServerWizardPage(CDK3_SERVER_NAME, serverAdapter);
    // set second new server dialog page
    NewCDK3ServerWizardPage containerPage = new NewCDK3ServerWizardPage();
    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);
    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 : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDK3ServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDK3ServerWizardPage) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

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