Search in sources :

Example 61 with OkButton

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

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

the class LabelsTest method setValidLabel.

private void setValidLabel() {
    new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText("valid");
    new LabeledText(OpenShiftLabel.TextLabels.VALUE).setText("valid");
    assertTrue("OK button should be enabled for valid name and value, but it is not.", buttonIsEnabled(new OkButton()));
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText)

Example 63 with OkButton

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

the class LabelsTest method testBasicLabelValidation.

@Test
public void testBasicLabelValidation() {
    openResourceLabelShell();
    LabeledText name = new LabeledText(OpenShiftLabel.TextLabels.LABEL);
    LabeledText value = new LabeledText(OpenShiftLabel.TextLabels.VALUE);
    assertFalse("OK button should be disable if there is no name nor value for a new label.", buttonIsEnabled(new OkButton()));
    // Set valid label with all allowed character
    name.setText("valid.prefix/valid_Label-Name1");
    value.setText("valid.Label-value_1");
    assertTrue("OK button should be enabled for valid name and value, but it is not.", buttonIsEnabled(new OkButton()));
    name.setText("invalid.");
    value.setText("invalid.");
    assertFalse("OK button should be disable for invalid name and value, but it is not.", buttonIsEnabled(new OkButton()));
    closeResourceLabelShell();
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) Test(org.junit.Test)

Example 64 with OkButton

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

the class LabelsTest method setInvalidName.

private void setInvalidName(String name) {
    new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText(name);
    assertFalse("OK button should be disable for invalid name, but it is not.", buttonIsEnabled(new OkButton()));
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText)

Example 65 with OkButton

use of org.eclipse.reddeer.swt.impl.button.OkButton 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)

Aggregations

OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)73 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)48 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)45 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)43 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)37 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)32 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)32 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)22 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)17 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)15 Test (org.junit.Test)15 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)11 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)11 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)10 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)9 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)9 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)7 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6 Shell (org.eclipse.reddeer.swt.api.Shell)6 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)6