use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project linuxtools by eclipse.
the class AbstractDockerBotTest method setSecureStorage.
public static void setSecureStorage(String password) {
try {
new DefaultShell("Secure Storage Password");
new LabeledText("Password:").setText(password);
new LabeledText("Confirm password:").setText(password);
new PushButton("OK").click();
new DefaultShell("Secure Storage - Password Hint Needed");
new PushButton("NO").click();
} catch (CoreLayerException ex) {
// swallowing intentionally
} catch (SWTLayerException e) {
try {
new DefaultShell("Secure Storage");
new LabeledText("Password:").setText(password);
new LabeledText("Confirm password:").setText(password);
new PushButton("OK").click();
} catch (SWTLayerException ex) {
// Secure storage password is set
} catch (CoreLayerException ex) {
// Confirm password
new PushButton("OK").click();
}
}
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project linuxtools by eclipse.
the class EditDockerFileTest method testEditDockerFile.
@Test
public void testEditDockerFile() {
getConnection();
DockerImagesTab imageTab = openDockerImagesTab();
try {
String dockerFilePath = new File(EDIT_DOCKERFILE_FOLDER).getCanonicalPath();
getConnection();
imageTab.activate();
new DefaultToolItem("Build Image").click();
new WaitUntil(new ShellIsAvailable("Build a Docker Image"));
new LabeledText("Image Name:").setText(IMAGE_NAME);
new LabeledText("Directory:").setText(dockerFilePath);
new PushButton("Edit Dockerfile").click();
new WaitUntil(new ShellIsAvailable("Dockerfile Editor"), TimePeriod.LONG);
DefaultStyledText defaultStyledText = new DefaultStyledText();
String editorText = defaultStyledText.getText();
assertTrue("Editor is empty!", StringUtils.isNotEmpty(editorText));
defaultStyledText.setText(BUILD_IMAGE);
CTabFolder tabFolder = new DefaultCTabFolder();
CTabItem tabItem = tabFolder.getSelection();
KeyboardFactory.getKeyboard().invokeKeyCombination(SWT.CTRL, 'S');
tabItem.close();
new DefaultShell("Build a Docker Image").setFocus();
new FinishButton().click();
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
} catch (IOException ex) {
fail("Resource file not found!");
}
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project linuxtools by eclipse.
the class ComposeTest method runDockerCompose.
private void runDockerCompose(String project, String projectFile) {
PackageExplorerPart pe = new PackageExplorerPart();
pe.open();
pe.getProject(project).getProjectItem(projectFile).select();
@SuppressWarnings("unchecked") ContextMenuItem contextMenu = new ContextMenuItem(new WithTextMatcher("Run As"), new RegexMatcher(".*Docker Compose"));
contextMenu.select();
new OkButton().click();
try {
new DefaultShell("Docker Compose");
new PushButton("Apply and Close").click();
fail("Docker Compose has not been found! Is it installed and the path is correct?");
} catch (CoreLayerException ex) {
}
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
new WaitWhile(new ConsoleHasNoChange());
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project linuxtools by eclipse.
the class ImageRunSelectionPage method addExposedPort.
public void addExposedPort(String containerPort, String hostAddress, String hostPort) {
new PushButton(0, new WithTextMatcher("Add...")).click();
new DefaultShell("Exposing a Container Port");
new LabeledText("Container port:").setText(containerPort);
new LabeledText("Host address:").setText(hostAddress);
new LabeledText("Host port:").setText(hostPort);
new OkButton().click();
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project linuxtools by eclipse.
the class AbstractView method openViaMenu.
private void openViaMenu() {
WithTextMatchers m = new WithTextMatchers(new RegexMatcher[] { new RegexMatcher("Window.*"), new RegexMatcher("Show View.*"), new RegexMatcher("Other...*") });
new ShellMenu().getItem(m.getMatchers()).select();
new DefaultShell(SHOW_VIEW);
new DefaultTreeItem(path).select();
new PushButton("Open").click();
new WaitWhile(new ShellIsAvailable(SHOW_VIEW));
new WaitUntil(new ViewCTabIsAvailable());
}
Aggregations