Search in sources :

Example 26 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton 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 27 with FinishButton

use of org.eclipse.reddeer.swt.impl.button.FinishButton 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 28 with FinishButton

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

the class Service method createServerAdapter.

/**
 * Creates server adapter for this service with default values.
 */
public void createServerAdapter() {
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS));
    new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) 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) JobIsKilled(org.eclipse.reddeer.workbench.core.condition.JobIsKilled) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 29 with FinishButton

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

the class BuilderImageApplicationWizardHandlingTest method testGitFieldsValidationOnBuildConfigurationWizardPage.

@Test
public void testGitFieldsValidationOnBuildConfigurationWizardPage() {
    nextToBuildConfigurationWizardPage();
    LabeledText gitRepo = new LabeledText(OpenShiftLabel.TextLabels.GIT_REPO_URL);
    LabeledText gitReference = new LabeledText(OpenShiftLabel.TextLabels.GIT_REF);
    LabeledText contextDirectory = new LabeledText(OpenShiftLabel.TextLabels.CONTEXT_DIR);
    String defaultRepo = gitRepo.getText();
    String defaultRef = gitReference.getText();
    String defaultContextDir = contextDirectory.getText();
    validateGitRepoURL("invalid");
    validateGitRepoURL("");
    setDefaultValuesAndAssert(defaultRepo, defaultRef, defaultContextDir);
    gitReference.setText("");
    contextDirectory.setText("");
    assertTrue("Next button should be enabled if ref and context dir are empty.", new NextButton().isEnabled());
    assertTrue("Finish button should be enabled if ref and context dir are empty.", new FinishButton().isEnabled());
    setDefaultValuesAndAssert(defaultRepo, defaultRef, defaultContextDir);
    validateGitReference("invalid reference");
    validateGitReference("invalidad*reference");
    validateGitReference("invalid:reference");
    validateGitReference("@");
    validateGitReference("invalid\reference");
    setDefaultValuesAndAssert(defaultRepo, defaultRef, defaultContextDir);
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) Test(org.junit.Test)

Example 30 with FinishButton

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

the class BuilderImageApplicationWizardHandlingTest method validateGitReference.

private void validateGitReference(String ref) {
    new LabeledText(OpenShiftLabel.TextLabels.GIT_REF).setText(ref);
    assertFalse("Next button should be disabled if git reference is invalid", new NextButton().isEnabled());
    assertFalse("Finish button should be disabled if git reference is invalid", new FinishButton().isEnabled());
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText)

Aggregations

FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)59 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)36 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)32 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)31 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)30 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)28 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)24 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)23 Test (org.junit.Test)14 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)13 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)11 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)9 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)8 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)8 NewCDKServerWizard (org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard)8 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)6 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)6 ContextMenu (org.eclipse.reddeer.swt.impl.menu.ContextMenu)6 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)6