use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.
the class CDKServerWizardAbstractTest method assertServerType.
protected void assertServerType(final String serverType) {
NewCDKServerWizard wizard = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
try {
TreeItem item = new DefaultTreeItem(new String[] { SERVER_TYPE_GROUP }).getItem(serverType);
item.select();
assertTrue(item.getText().equalsIgnoreCase(serverType));
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
} catch (CoreLayerException coreExp) {
log.error(coreExp.getMessage());
fail("Server type " + serverType + " was not found in New Server Wizard");
}
assertEquals(new LabeledText("Server's host name:").getText(), "localhost");
assertEquals(new LabeledText("Server name:").getText(), getServerAdapter());
new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.MEDIUM, false);
assertTrue("Dialog button Next is not enabled!", wizard.isNextEnabled());
try {
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
new CancelButton().click();
} catch (WaitTimeoutExpiredException exc) {
exc.printStackTrace();
log.error("Dialog could not be canceled because there were unfinished jobs running after timeout" + "\n\rTrying to cancel dialog manually");
new DefaultShell("New Server").close();
}
}
use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.
the class DebuggingEAPAppTest method teardown.
@After
public void teardown() {
try {
new ShellMenuItem("Run", "Terminate").select();
} catch (CoreLayerException ex) {
if (ex.getMessage().contains("Menu item is not enabled")) {
// no big deal, there is no execution running
} else {
throw ex;
}
}
// remove all breakpoints
BreakpointsView breakpointsView = new BreakpointsView();
breakpointsView.open();
breakpointsView.removeAllBreakpoints();
}
use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.
the class CreateApplicationFromTemplateTest method importApplicationAndVerify.
public static void importApplicationAndVerify(String projectName) {
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
try {
new CheckBox(new WithTextMatcher(new StringStartsWith("Do not clone"))).toggle(true);
} catch (CoreLayerException ex) {
// git directory is not in use
} catch (WaitTimeoutExpiredException ex) {
// swallow, checkbox is disabled
}
new FinishButton().click();
ProjectExplorer projectExplorer = new ProjectExplorer();
projectExplorer.open();
OpenShiftUtils.handleCheatSheetCreateServerAdapter();
new WaitUntil(new ProjectExists(projectName, new ProjectExplorer()), TimePeriod.LONG, false);
assertTrue("Project Explorer should contain imported project " + projectName, projectExplorer.containsProject(projectName));
}
use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.
the class GetOpenShiftIOTokenTest method testGetToken.
@Test
public void testGetToken() {
new DefaultToolItem(new WorkbenchShell(), "Connect to OpenShift.io").click();
DefaultShell browser = new DefaultShell();
InternalBrowser internalBrowser = new InternalBrowser(browser);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new BrowserContainsText("OpenShift.io Developer Preview"), TimePeriod.LONG);
internalBrowser.execute(String.format("document.getElementById(\"username\").value=\"%s\"", DatastoreOS3.OPENSHIFT_IO_USERNAME));
internalBrowser.execute(String.format("document.getElementById(\"password\").value=\"%s\"", DatastoreOS3.OPENSHIFT_IO_PASSWORD));
internalBrowser.execute("document.getElementById(\"password\").parentElement.parentElement.parentElement.submit()");
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
try {
new DefaultShell("OpenShift.io");
} catch (CoreLayerException ex) {
// Secure storage has been triggered
SecureStorage.handleSecureStoragePasswordAndHint(SystemProperties.SECURE_STORAGE_PASSWORD);
new DefaultShell("OpenShift.io");
}
new OkButton().click();
checkAccountInProperties();
checkPluginInSecureStorage();
}
use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.
the class SecureStorage method provideSecureStoragePassword.
private static boolean provideSecureStoragePassword(String password) {
try {
new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD);
} catch (CoreLayerException ex) {
LOGGER.info(String.format("Shell with label \"%s\" was not found. Trying \"%s\"", OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD, OpenShiftLabel.Shell.SECURE_STORAGE));
new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE);
}
new DefaultText(0).setText(password);
boolean firstStorage = true;
try {
new DefaultText(1).setText(password);
} catch (RedDeerException ex) {
firstStorage = false;
}
new WaitUntil(new ControlIsEnabled(new OkButton()));
new OkButton().click();
return firstStorage;
}
Aggregations