Search in sources :

Example 41 with WaitTimeoutExpiredException

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

the class NewApplicationWizardHandlingTest method verifyDefinedResourcesForTemplate.

private void verifyDefinedResourcesForTemplate() {
    try {
        new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES)), TimePeriod.DEFAULT);
    } catch (WaitTimeoutExpiredException ex) {
        fail("Defined Resources button is not enabled");
    } catch (CoreLayerException ex) {
        // Defined resources button was not found
        throw new OpenshiftTestInFailureException("Defined resources button was not found. Probable cause: JBIDE-24492", ex);
    }
    new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).click();
    new DefaultShell(OpenShiftLabel.Shell.TEMPLATE_DETAILS);
    List<TreeItem> items = new DefaultTree().getItems();
    assertTrue("There should be build config item in tree describing resources", items.get(0).getText().contains("BuildConfig"));
    assertTrue("There should be deployment config item in tree describing resources", items.get(1).getText().contains("DeploymentConfig"));
    assertTrue("There should be image stream item in tree describing resources", items.get(2).getText().contains("ImageStream"));
    assertTrue("There should be route item in tree describing resources", items.get(3).getText().contains("Route"));
    assertTrue("There should be service item in tree describing resources", items.get(4).getText().contains("Service"));
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.TEMPLATE_DETAILS), TimePeriod.DEFAULT);
}
Also used : OpenshiftTestInFailureException(org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 42 with WaitTimeoutExpiredException

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

the class TemplateParametersTest method testModifyTemplateParameter.

@Test
public void testModifyTemplateParameter() {
    new DefaultTable().getItem(SOURCE_REPOSITORY_URL).select();
    new PushButton(OpenShiftLabel.Button.EDIT).click();
    new DefaultShell(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER);
    new DefaultText().setText(PERSONAL_GIT_REPO_URI);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER));
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    assertTrue("New value of git repo URI has not been modified successfully.", new DefaultTable().getItem(SOURCE_REPOSITORY_URL).getText(1).equals(PERSONAL_GIT_REPO_URI));
    new PushButton(OpenShiftLabel.Button.RESET).click();
    try {
        new WaitUntil(new TableContainsItem(new DefaultTable(), SOURCE_REPOSITORY_URL_VALUE, 1), TimePeriod.DEFAULT);
    } catch (WaitTimeoutExpiredException ex) {
        fail("Value for git repo URI has not been reset.");
    }
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) 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) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) TableContainsItem(org.eclipse.reddeer.swt.condition.TableContainsItem) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Test(org.junit.Test)

Example 43 with WaitTimeoutExpiredException

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

the class ServerAdapterFromResourceTest method importProject.

@BeforeClass
public static void importProject() {
    explorer = new OpenShiftExplorerView();
    explorer.open();
    project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(DatastoreOS3.TEST_PROJECT);
    project.getServicesWithName(OpenShiftResources.NODEJS_SERVICE).get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    ImportApplicationWizard appWizard = new ImportApplicationWizard();
    try {
        CheckBox checkBox = new CheckBox("Do not clone - use existing repository");
        if (checkBox.isEnabled()) {
            checkBox.toggle(true);
            LOGGER.debug("Using existing project, skipping import");
        }
    } catch (RedDeerException ex) {
        LOGGER.debug("No existing project found, importing");
    }
    try {
        appWizard.finish();
    } catch (WaitTimeoutExpiredException ex) {
        // When running test in suite, it needs to be selected correct build config(in OpenShift instance could be more build configs)
        appWizard.selectExistingBuildConfiguration(OpenShiftResources.NODEJS_APP_DEPLOYMENT_CONFIG);
        appWizard.finish();
    }
    new WaitUntil(new OpenShiftResourceExists(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, ResourceState.UNSPECIFIED, DatastoreOS3.TEST_PROJECT, connectionReq.getConnection()), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) BeforeClass(org.junit.BeforeClass)

Example 44 with WaitTimeoutExpiredException

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

the class ServerAdapterFromResourceTest method assertAdapterWorks.

private void assertAdapterWorks() {
    String serverName = adapter.getLabel();
    Server server = new ServersView2().getServer(serverName);
    try {
        new WaitUntil(new ServerHasState(server, ServerState.STARTED), TimePeriod.LONG);
    } catch (WaitTimeoutExpiredException ex) {
        throw new OpenshiftTestInFailureException("https://issues.jboss.org/browse/JBIDE-24241", ex);
    }
}
Also used : OpenshiftTestInFailureException(org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException) ServerHasState(org.eclipse.reddeer.eclipse.condition.ServerHasState) Server(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.Server) ServersView2(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 45 with WaitTimeoutExpiredException

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

the class CreateResourcesTest method assertResourceShellIsAvailable.

private void assertResourceShellIsAvailable() {
    try {
        new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_RESOURCE));
    } catch (WaitTimeoutExpiredException ex) {
        fail("New OpenShift resource shell has not been opened");
    }
    new DefaultShell(OpenShiftLabel.Shell.NEW_RESOURCE);
    new WaitUntil(new ControlIsEnabled(new CancelButton()), TimePeriod.LONG);
    new CancelButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_RESOURCE));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)46 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)34 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)23 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)18 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)17 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)15 Test (org.junit.Test)12 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)10 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)10 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)8 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)7 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)7 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)6 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)6 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)5 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)5 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)4 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)4