use of org.jboss.tools.openshift.reddeer.condition.BrowserContainsText in project jbosstools-openshift by jbosstools.
the class PublishChangesTest method verifyChangesTookEffect.
private void verifyChangesTookEffect() {
new ServerAdapter(Version.OPENSHIFT3, "eap-app", "Service").select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.SHOW_IN_WEB_BROWSER).select();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
try {
new WaitUntil(new BrowserContainsText("Hello"), TimePeriod.VERY_LONG);
} catch (WaitTimeoutExpiredException ex) {
fail("Application was not deployed successfully because it is not shown in web browser properly.");
}
}
use of org.jboss.tools.openshift.reddeer.condition.BrowserContainsText 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.jboss.tools.openshift.reddeer.condition.BrowserContainsText in project jbosstools-openshift by jbosstools.
the class DeployDockerImageTest method verifyDeployedHelloWorldDockerImage.
/**
* Verifies whether an application pod has been created and application is running successfully.
*/
private void verifyDeployedHelloWorldDockerImage(String projectName) {
new OpenShiftExplorerView().getOpenShift3Connection(openshiftConnectionRequirement.getConnection()).refresh();
try {
new WaitUntil(new OpenShiftResourceExists(Resource.POD, new StringContains("hello-openshift"), ResourceState.RUNNING, projectName, openshiftConnectionRequirement.getConnection()), TimePeriod.VERY_LONG);
} catch (WaitTimeoutExpiredException ex) {
fail("There should be a running application pod for a deployed docker image, " + "but it does not exist.");
}
new OpenShiftExplorerView().getOpenShift3Connection(openshiftConnectionRequirement.getConnection()).refresh();
new OpenShiftExplorerView().getOpenShift3Connection(openshiftConnectionRequirement.getConnection()).getProject(projectName).getOpenShiftResources(Resource.ROUTE).get(0).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.SHOW_IN_BROWSER).select();
try {
// getRouteURL("hello-openshift", projectName),
new WaitUntil(new BrowserContainsText("Hello OpenShift!"), TimePeriod.VERY_LONG);
} catch (WaitTimeoutExpiredException ex) {
fail("Browser does not contain hello world content.");
}
}
use of org.jboss.tools.openshift.reddeer.condition.BrowserContainsText 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();
}
Aggregations