Search in sources :

Example 51 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.

the class CDKServerEditorAbstractTest method checkEditorStateAfterSave.

protected void checkEditorStateAfterSave(String location, boolean canSave) {
    LabeledText label = ((CDKPart) editor).getMinishiftBinaryLabel();
    label.setText(location);
    new WaitUntil(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.SHORT, false);
    new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.DEFAULT, false);
    if (canSave) {
        verifyEditorCanSave();
    } else {
        verifyEditorCannotSave();
    }
}
Also used : SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) CDKPart(org.jboss.tools.cdk.reddeer.server.ui.editor.CDKPart) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 52 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.

the class CDKServerAdapterAbstractTest method setupCDKServerAbstract.

@Before
public void setupCDKServerAbstract() {
    // $NON-NLS-1$
    log.info("Open Servers view tab");
    setServersView(new CDKServersView());
    getServersView().open();
    // $NON-NLS-1$
    log.info("Getting server object from Servers View with name: " + getServerAdapter());
    setCDKServer(getServersView().getServer(getServerAdapter()));
    new WaitUntil(new JobIsRunning(), TimePeriod.DEFAULT, false);
}
Also used : CDKServersView(org.jboss.tools.cdk.reddeer.server.ui.CDKServersView) SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Before(org.junit.Before)

Example 53 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil 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 54 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.

the class CDK3ServerEditorTest method setServerEditor.

public void setServerEditor() {
    serversView = new CDKServersView();
    serversView.open();
    serversView.getServer(getServerAdapter()).open();
    editor = new CDK3ServerEditor(getServerAdapter());
    editor.activate();
    new WaitUntil(new JobIsRunning(), TimePeriod.getCustom(1), false);
}
Also used : CDK3ServerEditor(org.jboss.tools.cdk.reddeer.server.ui.editor.CDK3ServerEditor) CDKServersView(org.jboss.tools.cdk.reddeer.server.ui.CDKServersView) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 55 with WaitUntil

use of org.eclipse.reddeer.common.wait.WaitUntil 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)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)178 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)74 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)73 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)63 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)59 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)54 Test (org.junit.Test)44 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)40 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)36 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)36 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)34 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)30 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)25 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)22 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)20 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)18 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)18 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)15 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)13 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)12