Search in sources :

Example 66 with WaitWhile

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

the class DebuggingEAPAppTest method cleanAndBuildWorkspace.

private static void cleanAndBuildWorkspace() {
    new ShellMenuItem("Project", "Clean...").select();
    new DefaultShell("Clean");
    new PushButton("Clean").click();
    new WaitWhile(new JobIsRunning());
}
Also used : ShellMenuItem(org.eclipse.reddeer.swt.impl.menu.ShellMenuItem) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 67 with WaitWhile

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

the class CDKServer method operateServerState.

@Override
protected void operateServerState(String menuItem, final ServerState resultState) {
    ServerState actualState = this.getLabel().getState();
    MultipleWaitConditionHandler waitConditions = new MultipleWaitConditionHandler(waitConditionMatrix, " one of given wait condition is fulfilled");
    TimePeriod timeout = TimePeriod.VERY_LONG;
    if (menuItem == "Restart") {
        timeout = TimePeriod.getCustom(480);
    }
    log.debug("Operate server's state from: + '" + actualState + "' to '" + menuItem + "'");
    select();
    new ContextMenuItem(menuItem).select();
    // waiting until servers's state has changed from initial state into something else,
    // ie. stopped -> starting or started -> stopping
    new WaitWhile(new ServerHasState(this, actualState), TimePeriod.DEFAULT);
    // we might expect that after the state is changed it should not go back into initial state
    // or that problem dialog appears
    // later on, we might get "Multiple problems have occurred" dialog
    waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
    checkInitialStateChange(actualState);
    // decide if we wait for SSL acceptance dialog
    if ((actualState == ServerState.STOPPING || actualState == ServerState.STOPPED) && !getCertificatedAccepted()) {
        new WaitUntil(waitConditions, TimePeriod.getCustom(1020));
    }
    new WaitUntil(new ServerHasState(this, resultState), timeout);
    waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
    new WaitWhile(new SystemJobIsRunning(new JobMatcher("Inspecting CDK environment")), TimePeriod.DEFAULT);
    log.debug("Operate server's state finished, the result server's state is: '" + getLabel().getState() + "'");
}
Also used : SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ServerHasState(org.eclipse.reddeer.eclipse.condition.ServerHasState) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) JobMatcher(org.jboss.tools.cdk.reddeer.core.matcher.JobMatcher) TimePeriod(org.eclipse.reddeer.common.wait.TimePeriod) ServerState(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersViewEnums.ServerState) MultipleWaitConditionHandler(org.jboss.tools.cdk.reddeer.core.condition.MultipleWaitConditionHandler) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 68 with WaitWhile

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

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

the class CDKServerAdapterAbstractTest method collectConsoleOutput.

/**
 * Prints out console output via logger and returns console content
 *
 * @param log reference to logger
 * @param onFail if true then error log method is used, debug otherwise
 * @return returns console output
 */
public String collectConsoleOutput(Logger log, boolean onFail) {
    String consoleOutput = "Console is empty...";
    ConsoleView view = new ConsoleView();
    view.open();
    if (view.getConsoleText() != null) {
        new WaitWhile(new ConsoleHasNoChange(), TimePeriod.DEFAULT, false);
        consoleOutput = view.getConsoleLabel() + "\n\r" + view.getConsoleText();
        if (onFail) {
            log.info("Loggin console, called from test failure");
            log.error(consoleOutput);
        } else {
            log.info("Logging console for debugging purposes");
            log.debug(consoleOutput);
        }
    }
    return consoleOutput;
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 70 with WaitWhile

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

the class OpenNewApplicationWizardWithNoProjectTest method deleteTmpProject.

@After
public void deleteTmpProject() {
    OpenShift3Connection connection = new OpenShiftExplorerView().getOpenShift3Connection(connectionReq.getConnection());
    connection.refresh();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    if (connection.projectExists(projectName)) {
        connection.getProject(projectName).delete();
    }
    // Delete connection too
    new OpenShiftExplorerView().getOpenShift3Connection(connectionReq.getConnection()).remove();
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection) After(org.junit.After)

Aggregations

WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)209 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)142 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)97 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)84 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)72 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)49 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)45 Test (org.junit.Test)42 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)36 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)36 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)31 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)24 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)22 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)19 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)19 Shell (org.eclipse.reddeer.swt.api.Shell)17 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)17 DockerImagesTab (org.eclipse.linuxtools.docker.reddeer.ui.DockerImagesTab)16 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)16