Search in sources :

Example 11 with CheckBox

use of org.eclipse.reddeer.swt.impl.button.CheckBox in project jbosstools-openshift by jbosstools.

the class DebuggingEAPAppTest method rebuildProject.

private static void rebuildProject() {
    PackageExplorerPart pexplorer = new PackageExplorerPart();
    pexplorer.open();
    pexplorer.getProject(PROJECT_NAME).select();
    new ContextMenuItem("Maven", "Update Project...").select();
    new WaitUntil(new ShellIsAvailable("Update Maven Project"), TimePeriod.LONG);
    new CheckBox("Force Update of Snapshots/Releases").toggle(true);
    new PushButton("OK").click();
    new WaitWhile(new ShellIsAvailable("Update Maven Project"), TimePeriod.DEFAULT);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 12 with CheckBox

use of org.eclipse.reddeer.swt.impl.button.CheckBox in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromTemplateTest method importApplicationAndVerify.

public static void importApplicationAndVerify(String projectName) {
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    try {
        new CheckBox(new WithTextMatcher(new StringStartsWith("Do not clone"))).toggle(true);
    } catch (CoreLayerException ex) {
    // git directory is not in use
    } catch (WaitTimeoutExpiredException ex) {
    // swallow, checkbox is disabled
    }
    new FinishButton().click();
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    OpenShiftUtils.handleCheatSheetCreateServerAdapter();
    new WaitUntil(new ProjectExists(projectName, new ProjectExplorer()), TimePeriod.LONG, false);
    assertTrue("Project Explorer should contain imported project " + projectName, projectExplorer.containsProject(projectName));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) StringStartsWith(org.hamcrest.core.StringStartsWith) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ProjectExists(org.eclipse.reddeer.eclipse.condition.ProjectExists) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 13 with CheckBox

use of org.eclipse.reddeer.swt.impl.button.CheckBox in project jbosstools-openshift by jbosstools.

the class DeployDockerImageTest method proceedThroughDeployImageToOpenShiftWizard.

/**
 * Proceeds through the image if the first wizard page has correct details -
 * connection, project and image name.
 */
private void proceedThroughDeployImageToOpenShiftWizard() {
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT, false);
    assertTrue("Next button should be enabled if all details are set correctly", new NextButton().isEnabled());
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    new NextButton().click();
    if (!new CheckBox("Add Route").isChecked()) {
        new CheckBox("Add Route").click();
    }
    new FinishButton().click();
    new ShellWithButton("Deploy Image to OpenShift", "OK");
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable("Deploy Image to OpenShift"), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) ShellWithButton(org.jboss.tools.openshift.reddeer.widget.ShellWithButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 14 with CheckBox

use of org.eclipse.reddeer.swt.impl.button.CheckBox in project jbosstools-openshift by jbosstools.

the class SecureStorage method triggerSecureStorageOfPasswordInConnectionDialog.

/**
 * Triggers secure storage of password.
 *
 * @param username
 *            user name
 * @param server
 *            server
 * @param storePassword
 *            store password if value is set to true, remove password if value
 *            is set to false
 * @param serverType
 *            type of a server
 */
private static void triggerSecureStorageOfPasswordInConnectionDialog(String username, String server, boolean storePassword) {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    AbstractOpenShiftConnection connection = explorer.getOpenShiftConnection(username, server);
    connection.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_CONNECTION).select();
    new DefaultShell(OpenShiftLabel.Shell.EDIT_CONNECTION);
    // Store password if it is not stored
    if (!(new CheckBox(1).isChecked()) && storePassword) {
        new CheckBox(1).click();
        new FinishButton().click();
        TestUtils.acceptSSLCertificate();
        handleSecureStoragePasswordAndHint(SystemProperties.SECURE_STORAGE_PASSWORD);
    // Remove password if it is stored
    } else if (new CheckBox(1).isChecked() && !storePassword) {
        new CheckBox(1).click();
        new FinishButton().click();
    }
    new WaitWhile(new JobIsRunning());
}
Also used : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) AbstractOpenShiftConnection(org.jboss.tools.openshift.reddeer.view.resources.AbstractOpenShiftConnection) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)

Example 15 with CheckBox

use of org.eclipse.reddeer.swt.impl.button.CheckBox in project jbosstools-openshift by jbosstools.

the class PortForwardingTest method testFreePortsForPortForwarding.

@Test
public void testFreePortsForPortForwarding() {
    openPortForwardingDialog();
    CheckBox checkBox = new CheckBox(OpenShiftLabel.TextLabels.FIND_FREE_PORTS);
    Table table = new DefaultTable();
    assertTrue("Default port should be used for ping on first opening of Port forwarding dialog.", table.getItem("ping").getText(1).equals("8888"));
    assertTrue("Default port should be used for http on first opening of Port forwarding dialog.", table.getItem("http").getText(1).equals("8080"));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    checkBox.click();
    assertFalse("Free port port should be used for ping at this point.", table.getItem("ping").getText(1).equals("8888"));
    assertFalse("Free port should be used for http at this point.", table.getItem("http").getText(1).equals("8080"));
    checkBox.click();
    assertTrue("Default port should be used for ping at this point.", table.getItem("ping").getText(1).equals("8888"));
    assertTrue("Default port should be used for http at this point.", table.getItem("http").getText(1).equals("8080"));
}
Also used : DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) Table(org.eclipse.reddeer.swt.api.Table) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)32 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)11 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)9 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)8 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)8 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)7 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)7 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)7 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)6 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)5 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)5 Test (org.junit.Test)5 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)4 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)4 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)3 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)3 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)2 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)2 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)2 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)2