Search in sources :

Example 21 with CancelButton

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

the class TemplatesCreator method executeImport.

private void executeImport(boolean importProject) {
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    if (!importProject) {
        new CancelButton().click();
    } else {
        new FinishButton().click();
        try {
            new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET), TimePeriod.LONG);
            new DefaultShell(OpenShiftLabel.Shell.CHEATSHEET);
            new CheckBox(0).click();
            new NoButton().click();
            new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CHEATSHEET));
        } catch (WaitTimeoutExpiredException ex) {
        // do nothing if cheat sheet is not provided
        }
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
        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) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) NoButton(org.eclipse.reddeer.swt.impl.button.NoButton) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 22 with CancelButton

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

the class BuilderImageApplicationWizardHandlingTest method closeNewApplicationWizard.

@After
public void closeNewApplicationWizard() {
    new CancelButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning());
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) After(org.junit.After)

Example 23 with CancelButton

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

the class CreateResourcesTest method assertResourceShellIsAvailable.

private void assertResourceShellIsAvailable() {
    try {
        new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_RESOURCE));
    } catch (WaitTimeoutExpiredException ex) {
        fail("New OpenShift resource shell has not been opened");
    }
    new DefaultShell(OpenShiftLabel.Shell.NEW_RESOURCE);
    new WaitUntil(new ControlIsEnabled(new CancelButton()), TimePeriod.LONG);
    new CancelButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_RESOURCE));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 24 with CancelButton

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

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

the class CreateNewConnectionTest method invalidRegistryURLShouldReportErrorMessage.

@Test
@RunIf(conditionClass = ConnectionCredentialsExists.class)
public void invalidRegistryURLShouldReportErrorMessage() {
    openConnectionWizardAndSetDefaultServer();
    new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(AuthenticationMethod.BASIC.toString());
    new LabeledText(OpenShiftLabel.TextLabels.USERNAME).setText(DatastoreOS3.USERNAME);
    new LabeledText(OpenShiftLabel.TextLabels.PASSWORD).setText(DatastoreOS3.PASSWORD);
    new PushButton(OpenShiftLabel.Button.ADVANCED_OPEN).click();
    new LabeledText(OpenShiftLabel.TextLabels.IMAGE_REGISTRY_URL).setText("invalidURL");
    new WaitUntil(new ControlIsEnabled(new CancelButton()), TimePeriod.DEFAULT);
    new WaitUntil(new ControlIsEnabled(new DefaultText(" Please provide a valid image registry (HTTP/S) URL.")), TimePeriod.DEFAULT);
    new CancelButton().click();
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) RunIf(org.eclipse.reddeer.junit.execution.annotation.RunIf) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)29 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)19 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)18 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)13 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)11 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)10 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)8 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)6 After (org.junit.After)6 Test (org.junit.Test)6 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)5 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)3 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)3 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)3 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)3 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)3 DockerExplorerView (org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView)2 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)2 RunIf (org.eclipse.reddeer.junit.execution.annotation.RunIf)2 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)2