Search in sources :

Example 66 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project linuxtools by eclipse.

the class DockerImage method addTagToImage.

public void addTagToImage(String newTag) {
    select();
    new ContextMenu().getItem("Add Tag").select();
    new DefaultShell("Tag Image");
    new LabeledText("New Tag:").setText(newTag);
    new FinishButton().click();
}
Also used : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu)

Example 67 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project linuxtools by eclipse.

the class AbstractImageBotTest method setUpRegister.

protected void setUpRegister(String serverAddress, String email, String userName, String password) {
    WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
    RegistryAccountsPreferencePage page = new RegistryAccountsPreferencePage(dialog);
    dialog.open();
    dialog.select(page);
    page.removeRegistry(serverAddress);
    page.addRegistry(serverAddress, email, userName, password);
    try {
        new DefaultShell("New Registry Account").setFocus();
    } catch (CoreLayerException e) {
        new DefaultShell("Preferences").setFocus();
    }
    new PushButton("Apply and Close").click();
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) RegistryAccountsPreferencePage(org.eclipse.linuxtools.docker.reddeer.preferences.RegistryAccountsPreferencePage)

Example 68 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project linuxtools by eclipse.

the class ImageRunSelectionPage method addLinkToContainer.

public void addLinkToContainer(String containerName, String alias) {
    new PushButton(1, new WithTextMatcher("Add...")).click();
    new DefaultShell("Container Linking");
    new LabeledCombo("Container:").setText(containerName);
    new LabeledText("Alias:").setText(alias);
    new OkButton().click();
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 69 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class HandleCustomTemplateTest method createTemplateFromJson.

private void createTemplateFromJson() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject().select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_RESOURCE).select();
    new DefaultShell(OpenShiftLabel.Shell.NEW_RESOURCE);
    new LabeledText(OpenShiftLabel.TextLabels.RESOURCE_LOCATION).setText(System.getProperty("user.dir") + File.separator + "resources" + File.separator + "hello-world-template.json");
    new FinishButton().click();
    new DefaultShell(OpenShiftLabel.Shell.CREATE_RESOURCE_SUMMARY);
    assertTrue("Template is not listed in created resources summary", new DefaultTree().getAllItems().size() == 1);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_RESOURCE));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    List<OpenShiftResource> templates = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject().getOpenShiftResources(Resource.TEMPLATE);
    assertTrue("There should be precisely 1 created template for the project.", templates.size() > 0);
    String templateName = templates.get(0).getName();
    assertTrue("Template name '" + templateName + "' does not match required name " + "helloworld-sample.", templateName.equals("helloworld-sample"));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)

Example 70 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class ImportApplicationTest method testImportOpenShiftApplicationViaOpenShiftExplorer.

@Test
public void testImportOpenShiftApplicationViaOpenShiftExplorer() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    new WaitUntil(new OpenShiftResourceExists(Resource.BUILD_CONFIG, (Matcher<String>) null, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.LONG);
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.BUILD_CONFIG).get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    new CheckBox("Use default clone destination").toggle(false);
    File gitRepo = new File(GIT_REPO_DIRECTORY);
    new LabeledText("Git Clone Location:").setText(gitRepo.getAbsolutePath());
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.VERY_LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    assertTrue("There should be imported kitchen sink project, but there is not", projectExplorer.containsProject(PROJECT_NAME));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) Matcher(org.hamcrest.Matcher) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) File(java.io.File) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)129 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)84 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)83 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)57 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)49 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)46 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)41 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)36 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)28 Test (org.junit.Test)27 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)25 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)18 Shell (org.eclipse.reddeer.swt.api.Shell)17 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)17 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)17 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)16 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)16 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)16 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)16