Search in sources :

Example 81 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class CDKServer method confirmSSLCertificateDialog.

/**
 * Methods waits for SSL Certificate dialog shell to appear and then confirms dialog,
 * it might happen that certificate is already in place and no dialog is shown,
 * then WaitTimeoutExpiredException is logged but not raised
 */
private void confirmSSLCertificateDialog(Shell shell) {
    try {
        DefaultShell certificateDialog = new DefaultShell(shell);
        certificateDialog.setFocus();
        log.info("SSL Certificate Dialog appeared during " + getLabel().getState().toString());
        new PushButton(certificateDialog, "Yes").click();
        new WaitWhile(new ShellIsAvailable(certificateDialog));
        setCertificateAccepted(true);
    } catch (WaitTimeoutExpiredException ex) {
        String message = "WaitTimeoutExpiredException occured when handling Certificate dialog. " + "Dialog has not been shown";
        log.error(message);
        throw new CDKServerException(message, ex);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) CDKServerException(org.jboss.tools.cdk.reddeer.server.exception.CDKServerException) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 82 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class CDKServer method processProblemDialog.

private void processProblemDialog(Shell shell, String excMessage) {
    log.info("Processing passed shell dialog " + new DefaultShell(shell).getText());
    new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM, false);
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
    DefaultShell shellDialog = new DefaultShell(shell);
    log.info("Shell could have changed after getting another error");
    log.info("Actual shell dialog name is " + shellDialog.getText());
    CDKUtils.captureScreenshot("CDEServer#ProblemDialog#" + shellDialog.getText());
    new OkButton(shellDialog).click();
    throw new CDKServerException(excMessage);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) CDKServerException(org.jboss.tools.cdk.reddeer.server.exception.CDKServerException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 83 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class NewServerContainerWizardPage method disposeSecureStoragePassword.

@SuppressWarnings("unused")
private static void disposeSecureStoragePassword() {
    try {
        new WaitUntil(new ShellIsAvailable(SECURE_STORAGE), TimePeriod.MEDIUM, true);
        new DefaultShell(SECURE_STORAGE).close();
        new WaitWhile(new ShellIsAvailable(SECURE_STORAGE));
    } catch (WaitTimeoutExpiredException exc) {
        log.info("WaitTimeoutExpiredException occurred while waiting for Secure Storage Password dialog");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 84 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class OpenShift3ConnectionWizard method confirmMessageDialog.

private void confirmMessageDialog() {
    ShellIsAvailable confirm = new ShellIsAvailable(OpenShiftLabel.Shell.OVERWRITE_REGISTRY_URL);
    new WaitUntil(confirm, TimePeriod.MEDIUM);
    DefaultShell dialog = new DefaultShell(OpenShiftLabel.Shell.OVERWRITE_REGISTRY_URL);
    dialog.setFocus();
    new OkButton().click();
    new WaitWhile(confirm, TimePeriod.MEDIUM);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 85 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method createOpenShiftApplicationBasedOnTemplate.

private void createOpenShiftApplicationBasedOnTemplate(boolean importProject, boolean serverTemplate, String templateName, final String templateLocalPath, List<Label> labels, TemplateParameter... parameters) {
    if (serverTemplate) {
        selectServerTemplate(templateName);
    } else {
        selectLocalTemplate(templateLocalPath);
    }
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    if (parameters != null && parameters.length != 0) {
        setTemplateParameters(parameters);
    }
    new NextButton().click();
    new WaitWhile(new ControlIsEnabled(new NextButton()), TimePeriod.LONG);
    if (labels != null && labels.size() != 0) {
        createOpenShiftLabels(labels);
    }
    new FinishButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    new OkButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    executeImport(importProject);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)129 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)84 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)83 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)57 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)49 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)46 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)41 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)36 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)28 Test (org.junit.Test)27 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)25 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)18 Shell (org.eclipse.reddeer.swt.api.Shell)17 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)17 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)17 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)16 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)16 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)16 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)16