use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class NewOpenShift3ApplicationWizard method openWizardFromExplorer.
/**
* Opens a new OpenShift 3 application wizard from OpenShift Explorer view with the given project pre-selected.
* If the project is null, a generated project is used.
*/
public void openWizardFromExplorer(String project) {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
selectExplorerProject(project, explorer);
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_OS3_APPLICATION).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class DeleteResourcesWizard method openWizardFromExplorer.
/**
* Opens a new OpenShift 3 Delete Resources... wizard from OpenShift Explorer view with the given project pre-selected.
* If the project is null, a generated project is used.
*
* @param project project name for deleting resources
*/
public void openWizardFromExplorer(String project) {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.reopen();
selectExplorerProject(project, explorer);
new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_RESOURCES).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.DELETE_OS_RESOURCES), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.DELETE_OS_RESOURCES);
new WaitUntil(new TableHasRows(new DefaultTable()), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class DeleteProjectTest method testDeleteProjectViaManageProjectsShell.
@Test
public void testDeleteProjectViaManageProjectsShell() {
projectExists = true;
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.open();
OpenShift3Connection connection = explorer.getOpenShift3Connection(connectionReq.getConnection());
connection.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_OS_PROJECTS).select();
new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS);
new DefaultTable().getItem(PROJECT_NAME).select();
new PushButton(OpenShiftLabel.Button.REMOVE).click();
new DefaultShell(OpenShiftLabel.Shell.DELETE_RESOURCE);
new OkButton().click();
projectExists = false;
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.DELETE_OS_PROJECT), TimePeriod.LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new ControlIsEnabled(new PushButton("Refresh...")), TimePeriod.DEFAULT);
new PushButton("Refresh...").click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new ProjectDoesNotExistInManageOSProject(new DefaultShell(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS), PROJECT_NAME), TimePeriod.LONG);
assertFalse("There should not be present project in the table.", new DefaultTable().containsItem(PROJECT_NAME));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.MANAGE_OS_PROJECTS), TimePeriod.LONG);
assertFalse("Project is still presented in OpenShift explorer under a connection.", connection.projectExists(PROJECT_NAME));
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class ServerAdapterFromResourceTest method importProject.
@BeforeClass
public static void importProject() {
explorer = new OpenShiftExplorerView();
explorer.open();
project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(DatastoreOS3.TEST_PROJECT);
project.getServicesWithName(OpenShiftResources.NODEJS_SERVICE).get(0).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
ImportApplicationWizard appWizard = new ImportApplicationWizard();
try {
CheckBox checkBox = new CheckBox("Do not clone - use existing repository");
if (checkBox.isEnabled()) {
checkBox.toggle(true);
LOGGER.debug("Using existing project, skipping import");
}
} catch (RedDeerException ex) {
LOGGER.debug("No existing project found, importing");
}
try {
appWizard.finish();
} catch (WaitTimeoutExpiredException ex) {
// When running test in suite, it needs to be selected correct build config(in OpenShift instance could be more build configs)
appWizard.selectExistingBuildConfiguration(OpenShiftResources.NODEJS_APP_DEPLOYMENT_CONFIG);
appWizard.finish();
}
new WaitUntil(new OpenShiftResourceExists(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, ResourceState.UNSPECIFIED, DatastoreOS3.TEST_PROJECT, connectionReq.getConnection()), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-openshift by jbosstools.
the class ImportApplicationWizardGitTest method testNotMatchingRepoRemote.
@Test
public void testNotMatchingRepoRemote() {
Git repo = createRepo();
setRemote(repo);
service.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
ImportApplicationWizard importWizard = new ImportApplicationWizard();
assertProjectExistsErrorInWizard(importWizard);
GitCloningWizardPage gitCloningWizardPage = new GitCloningWizardPage();
gitCloningWizardPage.useExistingRepository(true);
assertGitRemoteErrorInWizzard(importWizard);
importWizard.cancel();
}
Aggregations