Search in sources :

Example 26 with CheckBox

use of org.eclipse.reddeer.swt.impl.button.CheckBox 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);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) BeforeClass(org.junit.BeforeClass)

Example 27 with CheckBox

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

the class ServerAdapterWizardHandlingTest method testPodPathWidgetAccessibility.

@Test
public void testPodPathWidgetAccessibility() {
    openNewServerAdapterWizard();
    next();
    new PushButton(OpenShiftLabel.Button.ADVANCED_OPEN).click();
    new CheckBox("Use inferred Pod Deployment Path").toggle(false);
    LabeledText podPath = new LabeledText("Pod Deployment Path: ");
    String podDeploymentPath = "/opt/eap/standalone/deployments/";
    podPath.setText("");
    assertFalse("Next button should be disable if pod path is empty is selected.", nextButtonIsEnabled());
    podPath.setText(podDeploymentPath);
    assertTrue("Next button should be reeenabled if pod path is correctly filled in.", nextButtonIsEnabled());
}
Also used : LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 28 with CheckBox

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

the class StoreConnectionTest method secureStorageDisabledJBIDE19604Test.

@Test
public void secureStorageDisabledJBIDE19604Test() {
    deleteSecureStorage();
    invokeNewAppWizardFromCentral();
    new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).toggle(true);
    new NextButton().click();
    // Cancel secure storage shell
    try {
        new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD);
    } catch (CoreLayerException ex) {
        new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE);
    }
    new CancelButton().click();
    // Cancel warning shell
    new DefaultShell("Warning");
    new OkButton().click();
    new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).toggle(false);
    // Next button should work
    new NextButton().click();
    AbstractWaitCondition backButtonIsEnabled = new AbstractWaitCondition() {

        @Override
        public boolean test() {
            return new BackButton().isEnabled();
        }
    };
    new WaitUntil(backButtonIsEnabled);
    new CancelButton().click();
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) AbstractWaitCondition(org.eclipse.reddeer.common.condition.AbstractWaitCondition) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 29 with CheckBox

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

the class OpenShiftExplorerView method connectToOpenShift.

public void connectToOpenShift(String server, String username, String password, boolean storePassword, boolean useDefaultServer, AuthenticationMethod authMethod, boolean certificateShown) {
    new DefaultShell(OpenShiftLabel.Shell.NEW_CONNECTION);
    if (new CheckBox(0).isChecked() != useDefaultServer) {
        new CheckBox(0).click();
    }
    if (!useDefaultServer) {
        new LabeledCombo(OpenShiftLabel.TextLabels.SERVER).setText(server);
    }
    new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(authMethod.toString());
    if (AuthenticationMethod.OAUTH.equals(authMethod)) {
        new LabeledText(OpenShiftLabel.TextLabels.TOKEN).setText(password);
    }
    if (AuthenticationMethod.BASIC.equals(authMethod)) {
        new LabeledText(OpenShiftLabel.TextLabels.USERNAME).setText(username);
        new LabeledText(OpenShiftLabel.TextLabels.PASSWORD).setText(password);
        if (new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).isChecked() != storePassword) {
            new CheckBox(OpenShiftLabel.TextLabels.STORE_PASSWORD).click();
        }
    }
    new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.DEFAULT);
    new FinishButton().click();
    if (certificateShown) {
        try {
            new DefaultShell(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE);
            new PushButton("Yes").click();
        } catch (RedDeerException ex) {
            fail("Aceptance of SSL certificate failed.");
        }
    }
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_CONNECTION), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 30 with CheckBox

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

the class GitCloningWizardPage method useExistingRepository.

public void useExistingRepository(boolean useExistingRepository) {
    CheckBox useExistingRepositoryCheckBox = new CheckBox(new DefaultGroup("Clone destination"), "Do not clone - use existing repository");
    useExistingRepositoryCheckBox.toggle(useExistingRepository);
}
Also used : CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) DefaultGroup(org.eclipse.reddeer.swt.impl.group.DefaultGroup)

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