Search in sources :

Example 76 with PushButton

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

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

the class LabelsTest method openResourceLabelShell.

private void openResourceLabelShell() {
    new PushButton(OpenShiftLabel.Button.ADD).click();
    new DefaultShell(OpenShiftLabel.Shell.RESOURCE_LABEL);
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 78 with PushButton

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

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

the class ServerAdapterWizardHandlingTest method testPodPathWidgetAccessibility.

@Test
public void testPodPathWidgetAccessibility() {
    openNewServerAdapterWizard();
    next();
    new PushButton(OpenShiftLabel.Button.ADVANCED_OPEN).click();
    new CheckBox("Use inferred Pod Deployment Path").toggle(false);
    LabeledText podPath = new LabeledText("Pod Deployment Path: ");
    String podDeploymentPath = "/opt/eap/standalone/deployments/";
    podPath.setText("");
    assertFalse("Next button should be disable if pod path is empty is selected.", nextButtonIsEnabled());
    podPath.setText(podDeploymentPath);
    assertTrue("Next button should be reeenabled if pod path is correctly filled in.", nextButtonIsEnabled());
}
Also used : LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 80 with PushButton

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

the class ServerAdapterWizardHandlingTest method testSourcePathWidgetAccessibility.

@Test
public void testSourcePathWidgetAccessibility() {
    openNewServerAdapterWizard();
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    next();
    new PushButton(OpenShiftLabel.Button.ADVANCED_OPEN).click();
    LabeledText srcPath = new LabeledText("Source Path: ");
    String srcPathText = srcPath.getText();
    srcPath.setText("");
    assertFalse("Next button should be disable if source path is empty is selected.", nextButtonIsEnabled());
    srcPath.setText(srcPathText);
    assertTrue("Next button should be reeenabled if source path is correctly filled in.", nextButtonIsEnabled());
    srcPath.setText("invalid path");
    assertFalse("Next button should be disabled if source path is invalid or not existing.", nextButtonIsEnabled());
    srcPath.setText(srcPathText);
    assertTrue("Next button should be reeenabled if source path is correctly filled in.", nextButtonIsEnabled());
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)94 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)49 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)43 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)41 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)38 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)38 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)34 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)28 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)20 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)17 Test (org.junit.Test)16 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)15 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)9 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)8 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)7 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)6 Button (org.eclipse.reddeer.swt.api.Button)6 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6