Search in sources :

Example 46 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.

the class CDKServerAdapterAbstractTest method addNewCDKServer.

/**
 * Creates new CDK 2.x server adapter via ServersView -> New -> Server
 *
 * @param serverAdapter server adapter name
 * @param path path to vagrantfile
 */
public static void addNewCDKServer(String serverAdapter, String path) {
    NewCDKServerWizard dialog = setupFirstNewServerWizardPage(CDK_SERVER_NAME, serverAdapter);
    // set second new server dialog page
    NewCDKServerWizardPage containerPage = new NewCDKServerWizardPage();
    containerPage.setCredentials(USERNAME, PASSWORD);
    // set cdk 2.x fields
    // $NON-NLS-1$
    log.info("Setting vagrant file folder");
    containerPage.setFolder(path);
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM);
    // $NON-NLS-1$
    log.info("Finishing Add new server dialog");
    if (!(new FinishButton().isEnabled())) {
        // $NON-NLS-1$
        log.error("Finish button was not enabled");
    }
    dialog.finish();
}
Also used : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) NewCDKServerWizardPage(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizardPage) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 47 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled 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 48 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.

the class DeleteProjectTest method testDeleteProjectViaManageProjectsShell.

@Test
public void testDeleteProjectViaManageProjectsShell() {
    projectExists = true;
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
    connection.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_OS_PROJECTS).select();
    new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS);
    new DefaultTable().getItem(PROJECT_NAME).select();
    new PushButton(OpenShiftLabel.Button.REMOVE).click();
    new DefaultShell(OpenShiftLabel.Shell.DELETE_RESOURCE);
    new OkButton().click();
    projectExists = false;
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.DELETE_OS_PROJECT), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ControlIsEnabled(new PushButton("Refresh...")), TimePeriod.DEFAULT);
    new PushButton("Refresh...").click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ProjectDoesNotExistInManageOSProject(new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS), PROJECT_NAME), TimePeriod.LONG);
    assertFalse("There should not be present project in the table.", new DefaultTable().containsItem(PROJECT_NAME));
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS), TimePeriod.LONG);
    assertFalse("Project is still presented in OpenShift explorer under a connection.", connection.projectExists(PROJECT_NAME));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShift3Connection(org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 49 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled 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)

Example 50 with ControlIsEnabled

use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.

the class CreateNewConnectionTest method invalidRegistryURLShouldReportErrorMessage.

@Test
@RunIf(conditionClass = ConnectionCredentialsExists.class)
public void invalidRegistryURLShouldReportErrorMessage() {
    openConnectionWizardAndSetDefaultServer();
    new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(AuthenticationMethod.BASIC.toString());
    new LabeledText(OpenShiftLabel.TextLabels.USERNAME).setText(DatastoreOS3.USERNAME);
    new LabeledText(OpenShiftLabel.TextLabels.PASSWORD).setText(DatastoreOS3.PASSWORD);
    new PushButton(OpenShiftLabel.Button.ADVANCED_OPEN).click();
    new LabeledText(OpenShiftLabel.TextLabels.IMAGE_REGISTRY_URL).setText("invalidURL");
    new WaitUntil(new ControlIsEnabled(new CancelButton()), TimePeriod.DEFAULT);
    new WaitUntil(new ControlIsEnabled(new DefaultText(" Please provide a valid image registry (HTTP/S) URL.")), TimePeriod.DEFAULT);
    new CancelButton().click();
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) RunIf(org.eclipse.reddeer.junit.execution.annotation.RunIf) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)54 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)54 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)31 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)25 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)25 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)24 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)19 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)18 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)17 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)17 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)14 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)14 Test (org.junit.Test)13 NewCDKServerWizard (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard)9 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)8 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)8 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)7 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)6 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6