use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class TemplatesCreator method executeImport.
private void executeImport(boolean importProject) {
new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
if (!importProject) {
new CancelButton().click();
} else {
new FinishButton().click();
try {
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.CHEATSHEET);
new CheckBox(0).click();
new NoButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET));
} catch (WaitTimeoutExpiredException ex) {
// do nothing if cheat sheet is not provided
}
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class TemplatesCreator method createOpenShiftLabels.
private void createOpenShiftLabels(List<Label> labels) {
for (Label label : labels) {
new PushButton(OpenShiftLabel.Button.ADD).click();
new DefaultShell(OpenShiftLabel.Shell.RESOURCE_LABEL);
new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText(label.getName());
new LabeledText(OpenShiftLabel.TextLabels.VALUE).setText(label.getValue());
new WaitUntil(new ControlIsEnabled(new OkButton()));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESOURCE_LABEL));
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
}
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class NewOpenShift3ApplicationWizard method openWizardFromExplorer.
/**
* Opens a new OpenShift 3 application wizard from OpenShift Explorer view with the given project pre-selected.
* If the project is null, a generated project is used.
*/
public void openWizardFromExplorer(String project) {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
selectExplorerProject(project, explorer);
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_OS3_APPLICATION).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class EnvironmentVariableWizardPage method resetEnvironmentVariable.
/**
* Resets environment variable to its default state.
*
* @param changedVar
* @param originalVar
* @return true if variable was reset successfully, false otherwise
*/
public boolean resetEnvironmentVariable(EnvVar changedVar, EnvVar defaultVar) {
DefaultTable table = new DefaultTable();
table.getItem(changedVar.getName()).select();
new PushButton(OpenShiftLabel.Button.RESET).click();
new DefaultShell(OpenShiftLabel.Shell.RESET_ENV_VAR);
new YesButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESET_ENV_VAR));
return table.containsItem(defaultVar.getName(), 0) && table.containsItem(defaultVar.getValue(), 1);
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class EnvironmentVariableWizardPage method resetAllVariables.
/**
* Resets all edited environment variables and check whether default variables passed as argument are
* displayed in the table.
*
* @param envVars environment variables to verify that were changed to default state
* @return true if variables were reset successfully, false otherwise
*/
public boolean resetAllVariables(EnvVar... envVars) {
DefaultTable table = new DefaultTable();
new PushButton(OpenShiftLabel.Button.RESET_ALL).click();
new DefaultShell(OpenShiftLabel.Shell.RESET_ENV_VAR);
new YesButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESET_ENV_VAR));
// If any of environment variables passed as argument were not reset, return false
if (envVars != null && envVars.length > 0) {
for (EnvVar envVar : envVars) {
if (!(table.containsItem(envVar.getName(), 0) && (table.containsItem(envVar.getValue(), 1)))) {
return false;
}
}
}
return true;
}
Aggregations