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.");
}
}
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()));
}
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();
}
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()));
}
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));
}
Aggregations