use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class EditResourcesTest method setOriginalBuildConfigContent.
@After
public void setOriginalBuildConfigContent() {
if (buildConfig != null) {
getBuildConfig().select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT).select();
TextEditor editor = new TextEditor(BUILD_CONFIG_EDITOR);
editor.setText(buildConfig);
editor.close(true);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class LogsTest method shouldShowLogFromBuildPodContextMenu.
@Test
public void shouldShowLogFromBuildPodContextMenu() {
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, new StringStartsWith("eap-app-"), ResourceState.RUNNING, requiredProject.getProjectName(), requiredConnection.getConnection()), TimePeriod.VERY_LONG);
this.consoleView = new ConsoleView();
this.consoleView.open();
OpenShiftResource pod = OpenShiftUtils.getOpenShiftPod(requiredProject.getProjectName(), Resource.BUILD, new StringStartsWith("eap-app-"), requiredConnection.getConnection());
String podName = pod.getName();
pod.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.BUILD_LOG).select();
new WaitUntil(new ConsoleHasText(), TimePeriod.LONG);
new WaitUntil(new ConsoleHasNoChange(TimePeriod.getCustom(WAIT_CONSOLE_NO_CHANGE)), TimePeriod.VERY_LONG);
assertTrue("Console label is incorrect, it should contain project name and name of build pod.\n" + "but label is: " + consoleView.getConsoleLabel(), consoleView.getConsoleLabel().contains(requiredProject.getProjectName() + "\\" + podName));
try {
new WaitUntil(new ConsoleHasText("Push successful"), TimePeriod.getCustom(WAIT_CONSOLE_PUSH_SUCCESS));
} catch (WaitTimeoutExpiredException ex) {
fail("There should be output of succesful build in console log, but there is not.\n" + "Check whether output has not changed. Assumed output in the end of log is 'Push successful'");
}
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class OSExplorerResourceTest method testDeploymentConfigVisibleAfterServiceDeletion.
/**
* Test if deployment config is visible in OS Explorer, when there is no service.
*/
@Test(expected = OpenshiftTestInFailureException.class)
public void testDeploymentConfigVisibleAfterServiceDeletion() {
this.project.expand();
Service service = this.project.getService(OpenShiftResources.EAP_SERVICE);
assertTrue("Service does not exist!", service != null);
service.select();
new ContextMenuItem("Delete").select();
new DefaultShell("Delete OpenShift Resource");
new OkButton().click();
// assert service is deleted
List<OpenShiftResource> resources = this.project.getOpenShiftResources(Resource.SERVICE);
assertTrue("Service not deleted!", resources.isEmpty());
try {
this.project.getTreeItem().getItem("eap-app selector: deploymentConfig=eap-app");
} catch (CoreLayerException e) {
// TODO: do not throw after JBIDE-24217 is fixed
throw new OpenshiftTestInFailureException("JBIDE-24217");
// TODO: uncomment after JBIDE-24217 is fixed
// fail("Deployment config not visible!");
}
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class TriggerBuildTest method testCreateNewBuildFromBuildConfig.
@Test
public void testCreateNewBuildFromBuildConfig() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD_CONFIG, (Matcher<String>) null, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.getCustom(120), true);
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD, "eap-app-1", ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.LONG, true);
List<OpenShiftResource> builds = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.BUILD);
int oldAmountOfBuilds = builds.size();
explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.BUILD_CONFIG).get(0).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.START_BUILD).select();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
try {
new WaitUntil(new AmountOfResourcesExists(Resource.BUILD, oldAmountOfBuilds + 1, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.LONG);
} catch (WaitTimeoutExpiredException ex) {
fail("New build was not triggered altough it should be.");
}
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class EditResourcesTest method testCanEditResource.
@Test
public void testCanEditResource() {
getBuildConfig().select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT).select();
try {
new TextEditor(new WithTextMatcher("*.eap-app.json"));
// pass
} catch (RedDeerException ex) {
fail("Text editor to modify build config resource has not been opened.");
}
}
Aggregations