public void deleteContainers(String dockerServer, String containerName) { open(); ConnectionItem dockerConnection = getConnection(dockerServer); TreeItem dc = dockerConnection.getTreeItem(); dc.select(); dc.expand(); TreeItem containersItem = dc.getItem("Containers"); containersItem.select(); containersItem.expand(); for (TreeItem item : containersItem.getItems()) { if (item.getText().contains(containerName)) { item.select(); Menu contextMenu = new ContextMenu("Remove"); if (!contextMenu.isEnabled()) { new ContextMenu("Stop").select(); new WaitWhile(new JobIsRunning(), TimePeriod.LONG); item.select(); contextMenu = new ContextMenu("Remove"); } contextMenu.select(); new WaitUntil(new ShellWithTextIsAvailable("Confirm Remove Container"), TimePeriod.NORMAL); new PushButton("OK").click(); new WaitWhile(new JobIsRunning(), TimePeriod.LONG); } } }
public void build() { select(); Menu menu = new ShellMenu("Project", "Build Project"); if (menu.isEnabled()) { menu.select(); } new WaitWhile(new JobIsRunning(), TimePeriod.LONG); }
@Test public void preferencesMenuTest() { log.info("Preferences menu test"); new DefaultShell(); Menu m = new ShellMenu("Window", "Preferences"); m.select(); Shell s = new DefaultShell("Preferences"); s.close(); }
@Test public void menuWithMnemonicTest() { log.info("menu with mnemonic test"); new DefaultShell(); Menu m = new ShellMenu("File", "New", "Other..."); m.select(); Shell s = new DefaultShell("New"); s.close(); }
@Test public void contextMenuTest() { ProjectExplorer pe = new ProjectExplorer(); pe.open(); Menu menu = new ContextMenu("New", "Project..."); menu.select(); Shell s = new DefaultShell("New Project"); s.close(); }
@Test public void aboutMenuTest() { log.info("About menu test"); new DefaultShell(); @SuppressWarnings("unchecked") Menu m = new ShellMenu( new WithMnemonicTextMatcher("Help"), new WithTextMatcher(new RegexMatcher("About.*"))); m.select(); Shell s = new DefaultShell(); s.close(); }
@Override public void setUp() { super.setUp(); // Open Internal Web Browser // TODO: should be replaced with Internal Web Browses view once it's implemented new DefaultShell(); RegexMatchers m = new RegexMatchers("Window.*", "Show View.*", "Other...*"); Menu menu = new ShellMenu(m.getMatchers()); menu.select(); new DefaultShell("Show View"); new DefaultTreeItem("General", "Internal Web Browser").select(); new PushButton("OK").click(); }
private void configureRestSupport(String wsProjectName, boolean enableRestSupport) { new ProjectExplorer().getProject(wsProjectName).select(); Menu menu = new ContextMenu( "Configure", enableRestSupport ? RestFullLabels.REST_SUPPORT_MENU_LABEL_ADD.getLabel() : RestFullLabels.REST_SUPPORT_MENU_LABEL_REMOVE.getLabel()); menu.select(); new WaitUntil(new JobIsRunning(), TimePeriod.NORMAL, false); }
private void generateJPAHibernateAnnotationsContextMenu() { PackageExplorer pe = new PackageExplorer(); pe.selectProjects(prj); TreeItem item = new DefaultTreeItem(prj, "src", pckg, "Dog.java"); item.select(); Menu menu = new ContextMenu("Source", "Generate Hibernate/JPA annotations"); menu.select(); new DefaultShell("Hibernate: add JPA annotations"); new PushButton("Next >").click(); new PushButton("Finish").click(); new WorkbenchShell(); new DefaultTreeItem(prj, "src", pckg, "Dog.java"); item.doubleClick(); TextEditor editor = new TextEditor("Dog.java"); StringHelper sh = new StringHelper(editor.getText()); sh.getPositionAfter("@Entity"); }