use of org.eclipse.reddeer.eclipse.ui.browser.BrowserEditor in project jbosstools-openshift by jbosstools.
the class BrowserIsReadyElseReloadCondition method test.
@Override
public boolean test() {
BrowserEditor browserEditor = null;
try {
browserEditor = new BrowserEditor(new BaseMatcher<String>() {
@Override
public boolean matches(Object arg0) {
return true;
}
@Override
public void describeTo(Description arg0) {
// TODO Auto-generated method stub
}
});
} catch (CoreLayerException ex) {
LOGGER.debug("CoreLayerException in waiting for browser in BrowserIsReadyElseReloadCondition");
LOGGER.debug(StackTraceUtils.stackTraceToString(ex));
return false;
}
String text = browserEditor.getText();
if (text.contains("Unable to load page") || text.contains("404")) {
LOGGER.debug("Refreshing browser");
new ServersView2().open();
serverAdapter.select();
new ContextMenuItem("Show In", "Web Browser").select();
return false;
} else {
// Browser is ready
return true;
}
}
use of org.eclipse.reddeer.eclipse.ui.browser.BrowserEditor in project jbosstools-openshift by jbosstools.
the class DeploymentTest method testDeploymentOfApplicationCreatedFromTemplate.
@Test
public void testDeploymentOfApplicationCreatedFromTemplate() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, "eap-app-1", ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.DEFAULT, false);
try {
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, "eap-app-1", ResourceState.COMPLETE, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(600), true);
} catch (WaitTimeoutExpiredException ex) {
fail("There should be a successful build of an application, but there is not.");
}
try {
new WaitUntil(new AmountOfResourcesExists(Resource.POD, 2, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(60), true);
} catch (WaitTimeoutExpiredException ex) {
fail("There should be precisely 2 pods. One of the build and one of an running application.");
}
explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.ROUTE).get(0).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.SHOW_IN_WEB_BROWSER).select();
try {
new WaitUntil(new BrowserContainsText("Hello World!"), TimePeriod.VERY_LONG);
new BrowserEditor("helloworld").close();
} catch (WaitTimeoutExpiredException ex) {
fail("Application was not deployed successfully because it is not shown in web browser properly.\n" + ex.getMessage());
}
}
use of org.eclipse.reddeer.eclipse.ui.browser.BrowserEditor in project jbosstools-openshift by jbosstools.
the class DeployDockerImageTest method closeBrowser.
public static void closeBrowser() {
try {
BrowserEditor browser = new BrowserEditor(new StringContains("hello"));
browser.close();
} catch (RedDeerException ex) {
// do nothing, browser is not opened
}
}
Aggregations