use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class EditResourceLimitsTest method incrementLimits.
private void incrementLimits(int index, String defaultSuffix) {
new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_RESOURCE_LIMITS).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_RESOURCE_LIMITS));
new DefaultShell(OpenShiftLabel.Shell.EDIT_RESOURCE_LIMITS).setFocus();
Text text = new DefaultText(index);
String value = text.getText();
long val = 0L;
try {
val = Long.parseLong(value);
} catch (NumberFormatException e) {
}
text.setText(Long.toString(++val));
Combo combo = new DefaultCombo(index);
value = combo.getSelection();
if (StringUtils.isEmpty(value)) {
combo.setSelection(defaultSuffix);
}
new WaitUntil(new ControlIsEnabled(new OkButton()));
new OkButton().click();
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class MinishiftServerWizardTest method testNewMinishiftServerWizard.
@Test
public void testNewMinishiftServerWizard() {
NewCDKServerWizard dialog = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
NewServerWizardPage page = new NewServerWizardPage(dialog);
page.selectType(SERVER_TYPE_GROUP, MINISHIFT_SERVER_NAME);
page.setName(getServerAdapter());
dialog.next();
NewMinishiftServerWizardPage containerPage = new NewMinishiftServerWizardPage();
checkWizardPagewidget("Minishift Binary: ", MINISHIFT_SERVER_NAME);
assertTrue(containerPage.getMinishiftProfile().getText().contains("minishift"));
// checking of minishift binary validation
// test that existing folder cannot be run
containerPage.setMinishiftBinary(EXISTING_PATH);
assertSameMessage(dialog, CANNOT_RUN_PROGRAM);
containerPage.setMinishiftBinary(NON_EXECUTABLE_FILE);
assertSameMessage(dialog, NOT_EXECUTABLE);
containerPage.setMinishiftBinary(NON_EXISTING_PATH);
assertSameMessage(dialog, DOES_NOT_EXIST);
containerPage.setMinishiftBinary(EXECUTABLE_FILE);
assertSameMessage(dialog, CHECK_MINISHIFT_VERSION);
// check compatibility of cdk version with server adapter
containerPage.setMinishiftBinary(MOCK_CDK311);
assertSameMessage(dialog, NOT_COMPATIBLE);
// check compatibility of cdk version with server adapter
containerPage.setMinishiftBinary(MOCK_CDK320);
assertSameMessage(dialog, NOT_COMPATIBLE);
// check compatibility of cdk version with server adapter
containerPage.setMinishiftBinary(MOCK_MINISHIFT131);
assertSameMessage(dialog, NOT_COMPATIBLE);
// Positive test of proper minishift binary
containerPage.setMinishiftBinary(MINISHIFT_PATH);
assertDiffMessage(dialog, CHECK_MINISHIFT_VERSION);
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM, false);
assertTrue("Expected Finish button is not enabled", dialog.isFinishEnabled());
dialog.cancel();
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class CDKTestUtils method setOCToPreferences.
public static void setOCToPreferences(String ocPath) {
WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
OpenShift3PreferencePage page = new OpenShift3PreferencePage(dialog);
dialog.open();
dialog.select(page);
page.setOCLocation(ocPath);
try {
new WaitUntil(new ControlIsEnabled(new PushButton("Apply")), TimePeriod.DEFAULT);
} catch (WaitTimeoutExpiredException exc) {
fail("WaitTimeoutExpiredException occured while processing oc binary on path " + ocPath);
}
page.apply();
dialog.cancel();
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class CreateServerAdapterTest method next.
private void next() {
new WaitUntil(new ControlIsEnabled(new NextButton()));
new NextButton().click();
TestUtils.acceptSSLCertificate();
new WaitUntil(new ControlIsEnabled(new BackButton()));
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class CDKServerEditorAbstractTest method addCDKServer.
public void addCDKServer() {
NewCDKServerWizard dialog = CDKTestUtils.openNewServerWizardDialog();
try {
setupServerWizardPage(dialog);
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM, false);
dialog.finish(TimePeriod.MEDIUM);
} catch (RedDeerException coreExc) {
new CancelButton().click();
throw new CDKServerException("Exception occured in CDK server wizard, wizard was canceled", coreExc);
}
}
Aggregations