Search in sources :

Example 16 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.

the class SecureStorage method handleSecureStoragePasswordAndHint.

public static void handleSecureStoragePasswordAndHint(String secureStoragePassword) {
    boolean firstStorage = provideSecureStoragePassword(secureStoragePassword);
    if (firstStorage) {
        // Did "Password hint needed" shell appear? Get rid of it.
        try {
            new DefaultShell(OpenShiftLabel.Shell.PASSWORD_HINT_NEEDED);
            new NoButton().click();
        } catch (CoreLayerException ex) {
            // do nothing
            LOGGER.debug("Password hint did not appear. Skipping.");
        }
    }
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) NoButton(org.eclipse.reddeer.swt.impl.button.NoButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 17 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException 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)

Example 18 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.

the class CredentialsWizardPage method cancelAddingUser.

public void cancelAddingUser() {
    try {
        Button cancel = new CancelButton();
        cancel.click();
    } catch (CoreLayerException exc) {
        throw new CoreLayerException("Canceling setting the credentials was not successful");
    }
}
Also used : CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) Button(org.eclipse.reddeer.swt.api.Button) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 19 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.

the class NewServerContainerWizardPage method setCredentials.

public void setCredentials(String username, String password) {
    log.info("Setting Red Hat Access credentials");
    getAddButton().click();
    CredentialsWizardPage credentialsPage = new CredentialsWizardPage();
    credentialsPage.setUsername(username);
    credentialsPage.setPassword(password);
    Button ok = new OkButton();
    if (ok.isEnabled()) {
        ok.click();
    } else {
        String text = credentialsPage.getDescriptionText().getText();
        if (text.length() > 0) {
            log.info("Adding new credential failed to add new user " + username);
            log.info("There is an error while setting Red Hat Credentials: \r\n" + text);
        }
        if (text.contains("already exists for domain access.redhat.com")) {
            credentialsPage.cancelAddingUser();
            return;
        }
        throw new CoreLayerException("Setting the credentials was not successful, " + "OK button is not enabled, error: \n\r" + text);
    }
// here might be placed code for disposal of secure storage
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Button(org.eclipse.reddeer.swt.api.Button) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 20 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.

the class CDKWrongCredentialsTest method closeAllErrorDialogs.

private void closeAllErrorDialogs() {
    try {
        new DefaultShell("Problem Occurred");
        new OkButton().click();
    } catch (CoreLayerException exc) {
        log.info("Problem Occurred dialog was not present");
    }
    try {
        new DefaultShell("Multiple problems have occurred");
        new OkButton().click();
    } catch (CoreLayerException exc) {
        log.info("Multiple problems have occurred dialog was not present");
    }
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Aggregations

CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)26 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)16 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)10 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)8 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)7 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)7 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)6 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)5 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)5 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)4 Test (org.junit.Test)4 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)3 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)3 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)3 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)3 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)3 OpenshiftTestInFailureException (org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException)3 AbstractWaitCondition (org.eclipse.reddeer.common.condition.AbstractWaitCondition)2 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)2