Search in sources :

Example 16 with RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.

the class OpenShift3ConnectionWizard method finishAndHandleCertificate.

public void finishAndHandleCertificate() {
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.LONG);
    new FinishButton().click();
    try {
        new DefaultShell(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE);
        new PushButton("Yes").click();
    } catch (RedDeerException ex) {
        fail("Aceptance of SSL certificate failed.");
    }
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_CONNECTION), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 17 with RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException in project linuxtools by eclipse.

the class LaunchDockerImageTest method deleteIfExists.

private void deleteIfExists(String configurationName) {
    RunDockerImageLaunchConfiguration runImageConf = new RunDockerImageLaunchConfiguration();
    try {
        runImageConf.open();
        runImageConf.deleteRunConfiguration(configurationName);
        runImageConf.close();
    } catch (RedDeerException e) {
    // catched intentionally
    }
}
Also used : RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) RunDockerImageLaunchConfiguration(org.eclipse.linuxtools.docker.reddeer.ui.RunDockerImageLaunchConfiguration)

Example 18 with RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.

the class HandleCustomTemplateTest method assertTemplateIsUsableInApplicationWizard.

private void assertTemplateIsUsableInApplicationWizard() {
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer();
    try {
        new DefaultTreeItem("helloworld-sample (instant-app) - " + DatastoreOS3.PROJECT1);
    } catch (RedDeerException ex) {
        fail("Template is not visible in New OpenShift application wizard although it should be.");
    }
    new CancelButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard)

Example 19 with RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.

the class EditResourcesTest method testIncorrectResourceContent.

@Test
public void testIncorrectResourceContent() {
    TextEditor editor = getBuildConfigTextEditor();
    String text = editor.getText();
    if (buildConfig == null) {
        buildConfig = text;
    }
    editor.setText(text.replace("\"namespace\" : \"" + DatastoreOS3.PROJECT1 + "\"", "\"namespace\" : \"" + DatastoreOS3.PROJECT1 + "\"wtf"));
    try {
        editor.save();
    } catch (CoreLayerException ex) {
    // ok
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
    assertTrue("Editor should be dirty, it should not be able to save incorrect content", editor.isDirty());
    try {
        new DefaultShell("Problem Occurred");
        new OkButton().click();
    } catch (RedDeerException ex) {
    // sometimes it occures, sometimes not
    }
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 20 with RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.

the class EditResourcesTest method testCanEditResource.

@Test
public void testCanEditResource() {
    getBuildConfig().select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT).select();
    try {
        new TextEditor(new WithTextMatcher("*.eap-app.json"));
    // pass
    } catch (RedDeerException ex) {
        fail("Text editor to modify build config resource has not been opened.");
    }
}
Also used : RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)34 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)12 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)11 Test (org.junit.Test)11 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)10 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)10 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)7 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)7 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)6 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)5 TextEditor (org.eclipse.reddeer.workbench.impl.editor.TextEditor)5 PackageExplorerPart (org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart)4 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)4 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)4 File (java.io.File)3 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)3 DefaultStyledText (org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText)3