Search in sources :

Example 1 with NoButton

use of org.eclipse.reddeer.swt.impl.button.NoButton in project jbosstools-openshift by jbosstools.

the class OpenShiftUtils method handleCheatSheetCreateServerAdapter.

public static void handleCheatSheetCreateServerAdapter() {
    try {
        new WaitUntil(new ShellIsAvailable(new WithTextMatcher(new RegexMatcher(OpenShiftLabel.Shell.CHEATSHEET + "|" + OpenShiftLabel.Shell.CREATE_SERVER_ADAPTER))), TimePeriod.LONG);
        new NoButton().click();
        new DefaultShell("Create server adapter");
        new NoButton().click();
    } catch (CoreLayerException ex) {
    // Swallow, shells are not opened
    } catch (WaitTimeoutExpiredException e) {
    // Also swallow, shells are not opened
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) NoButton(org.eclipse.reddeer.swt.impl.button.NoButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 2 with NoButton

use of org.eclipse.reddeer.swt.impl.button.NoButton 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 3 with NoButton

use of org.eclipse.reddeer.swt.impl.button.NoButton in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method executeImport.

private void executeImport(boolean importProject) {
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    if (!importProject) {
        new CancelButton().click();
    } else {
        new FinishButton().click();
        try {
            new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET), TimePeriod.LONG);
            new DefaultShell(OpenShiftLabel.Shell.CHEATSHEET);
            new CheckBox(0).click();
            new NoButton().click();
            new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET));
        } catch (WaitTimeoutExpiredException ex) {
        // do nothing if cheat sheet is not provided
        }
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
        new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) NoButton(org.eclipse.reddeer.swt.impl.button.NoButton) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

NoButton (org.eclipse.reddeer.swt.impl.button.NoButton)3 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)3 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)2 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)2 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)2 RegexMatcher (org.eclipse.reddeer.common.matcher.RegexMatcher)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)1 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)1 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)1 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1