Search in sources :

Example 1 with VariablesView

use of org.eclipse.reddeer.eclipse.debug.ui.views.variables.VariablesView in project jbosstools-openshift by jbosstools.

the class DebuggingEAPAppTest method checkVariablesView.

private void checkVariablesView() {
    VariablesView variablesView = new VariablesView();
    variablesView.open();
    // wait for variables to have correct value
    new WaitUntil(new AbstractWaitCondition() {

        @Override
        public boolean test() {
            return variablesView.getValue("name").equals("World");
        }
    });
    new WaitUntil(new AbstractWaitCondition() {

        @Override
        public boolean test() {
            return variablesView.getValue("this").contains("HelloService");
        }
    });
}
Also used : WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractWaitCondition(org.eclipse.reddeer.common.condition.AbstractWaitCondition) VariablesView(org.eclipse.reddeer.eclipse.debug.ui.views.variables.VariablesView)

Example 2 with VariablesView

use of org.eclipse.reddeer.eclipse.debug.ui.views.variables.VariablesView in project jbosstools-openshift by jbosstools.

the class DebuggingEAPAppTest method setNewVariableValue.

// TODO this should be replaced once
// https://github.com/jboss-reddeer/reddeer/issues/1668 is fixed.
private void setNewVariableValue(String newValue, final String... variablePath) {
    new WaitWhile(new JobIsRunning());
    LaunchView debugView = new LaunchView();
    debugView.open();
    ensureCorrectFrameIsSelected(debugView);
    VariablesView variablesView = new VariablesView();
    variablesView.open();
    new WaitUntil(new AbstractWaitCondition() {

        @Override
        public boolean test() {
            try {
                TreeItem variable = new DefaultTreeItem(variablePath);
                variable.select();
                return variable.isSelected();
            } catch (Exception e) {
                return false;
            }
        }

        @Override
        public String description() {
            return "Variable is not selected";
        }
    }, TimePeriod.LONG);
    try {
        new ContextMenuItem("Change Value...").select();
    } catch (CoreLayerException e) {
        throw e;
    }
    new DefaultShell("Change Object Value");
    new DefaultStyledText().setText(newValue);
    new OkButton().click();
    new WaitWhile(new JobIsRunning());
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) CaptureScreenshotException(org.eclipse.reddeer.junit.screenshot.CaptureScreenshotException) IOException(java.io.IOException) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) LaunchView(org.eclipse.reddeer.eclipse.debug.ui.views.launch.LaunchView) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractWaitCondition(org.eclipse.reddeer.common.condition.AbstractWaitCondition) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) VariablesView(org.eclipse.reddeer.eclipse.debug.ui.views.variables.VariablesView)

Aggregations

AbstractWaitCondition (org.eclipse.reddeer.common.condition.AbstractWaitCondition)2 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 VariablesView (org.eclipse.reddeer.eclipse.debug.ui.views.variables.VariablesView)2 IOException (java.io.IOException)1 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)1 LaunchView (org.eclipse.reddeer.eclipse.debug.ui.views.launch.LaunchView)1 CaptureScreenshotException (org.eclipse.reddeer.junit.screenshot.CaptureScreenshotException)1 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)1 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)1 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 DefaultStyledText (org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText)1 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1