use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-openshift by jbosstools.
the class ResourceLabelsWizardPage method deleteLabel.
/**
* Removes resource label
* @param name name of label to remove
* @return true if label has been removed successfully, false otherwise
*/
public boolean deleteLabel(String name) {
new DefaultTable().select(name);
new PushButton(OpenShiftLabel.Button.REMOVE).click();
new DefaultShell(OpenShiftLabel.Shell.REMOVE_LABEL);
new YesButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_LABEL));
return new DefaultTable().containsItem(name);
}
use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-openshift by jbosstools.
the class BuilderImageApplicationWizardHandlingTest method testPorts.
@Test
public void testPorts() {
String defaultName = "8443-tcp";
String defaultServicePort = "8443";
String defaultPodPort = "8443";
String newName = "1234-tcp";
String newServicePort = "1234";
String newPodPort = "4321";
nextToBuildConfigurationWizardPage();
next();
next();
// Test edit of an existing pod
new DefaultTable().select(defaultName);
new PushButton(OpenShiftLabel.Button.EDIT).click();
new DefaultShell(OpenShiftLabel.Shell.SERVICE_PORTS);
new LabeledText(OpenShiftLabel.TextLabels.POD_PORT).setText(newPodPort);
new DefaultSpinner(OpenShiftLabel.TextLabels.SERVICE_PORT).setValue(Integer.valueOf(newServicePort));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.SERVICE_PORTS));
assertTrue("There should port mapping with name " + newName + ", but there is not.", new WidgetIsFound(org.eclipse.swt.widgets.TableItem.class, new WithTextMatcher(newName)).test());
TableItem portMapping = new DefaultTable().getItem(newName);
assertTrue("Modified pod mapping has incorrect mapped ports.", portMapping.getText(1).equals(newServicePort) && portMapping.getText(2).equals(newPodPort));
// Test reset of pods
new PushButton(OpenShiftLabel.Button.RESET).click();
new DefaultShell(OpenShiftLabel.Shell.RESET_PORTS);
new YesButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESET_PORTS));
new WaitWhile(new JobIsRunning());
assertTrue("There should port mapping with name " + defaultName + ", but there is not.", new WidgetIsFound(org.eclipse.swt.widgets.TableItem.class, new WithTextMatcher(defaultName)).test());
portMapping = new DefaultTable().getItem(defaultName);
String resetServicePort = portMapping.getText(1);
String resetPodPort = portMapping.getText(2);
assertTrue("There should default values for port named " + defaultName + "\n" + "Service port should be " + defaultServicePort + ", but it is " + resetServicePort + " and pod port should be " + defaultPodPort + ", but it is " + resetPodPort, resetServicePort.equals(defaultServicePort) && resetPodPort.equals(defaultPodPort));
}
use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-openshift by jbosstools.
the class BuilderImageApplicationWizardHandlingTest method testManageDefaultEnvironmentVariable.
@Test
public void testManageDefaultEnvironmentVariable() {
nextToBuildConfigurationWizardPage();
next();
new DefaultTable().select(homeVar.getName());
assertFalse("Remove button should be disabled for read only variables", new PushButton(OpenShiftLabel.Button.REMOVE_BASIC).isEnabled());
assertTrue("Default variable has not been modified successfully", environmentVariablesPage.editEnvironmentVariable(homeVar, homeVar2));
assertTrue("Default variable has not been reset successfully", environmentVariablesPage.resetEnvironmentVariable(homeVar2, homeVar));
environmentVariablesPage.editEnvironmentVariable(homeVar, homeVar2);
environmentVariablesPage.editEnvironmentVariable(dataVar, dataVar2);
assertTrue("Default variables have not been reset successfully", environmentVariablesPage.resetAllVariables(homeVar, dataVar));
assertManagmentOfCustomEnvironmentVariable();
}
use of org.eclipse.reddeer.swt.impl.table.DefaultTable 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.table.DefaultTable 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