Search in sources :

Example 21 with OkButton

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

the class OpenShiftProject method delete.

/**
 * Deletes OpenShift project.
 */
public void delete() {
    item.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_OS_PROJECT).select();
    new DefaultShell(OpenShiftLabel.Shell.DELETE_OS_PROJECT);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.DELETE_OS_PROJECT), 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) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 22 with OkButton

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

the class OpenShiftResource method delete.

/**
 * Deletes resource via properties view.
 */
public void delete() {
    select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_RESOURCE).select();
    new DefaultShell(OpenShiftLabel.Shell.DELETE_RESOURCE);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.DELETE_RESOURCE), 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) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 23 with OkButton

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

the class SecureStorage method provideSecureStoragePassword.

private static boolean provideSecureStoragePassword(String password) {
    try {
        new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD);
    } catch (CoreLayerException ex) {
        LOGGER.info(String.format("Shell with label \"%s\" was not found. Trying \"%s\"", OpenShiftLabel.Shell.SECURE_STORAGE_PASSWORD, OpenShiftLabel.Shell.SECURE_STORAGE));
        new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE);
    }
    new DefaultText(0).setText(password);
    boolean firstStorage = true;
    try {
        new DefaultText(1).setText(password);
    } catch (RedDeerException ex) {
        firstStorage = false;
    }
    new WaitUntil(new ControlIsEnabled(new OkButton()));
    new OkButton().click();
    return firstStorage;
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 24 with OkButton

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

the class AbstractOpenShiftConnection method remove.

/**
 * Removes connection from OpenShift explorer view.
 */
public void remove() {
    item.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_CONNECTION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_CONNECTION));
    new DefaultShell(OpenShiftLabel.Shell.REMOVE_CONNECTION);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_CONNECTION));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 25 with OkButton

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

the class PortForwardingTest method testPortForwardingButtonsAccessibility.

@Test
public void testPortForwardingButtonsAccessibility() {
    openPortForwardingDialog();
    PushButton startAllButton = new PushButton(OpenShiftLabel.Button.START_ALL);
    PushButton stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
    OkButton okButton = new OkButton();
    assertTrue("Button Start All should be enabled at this point.", startAllButton.isEnabled());
    assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
    startAllButton.click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ControlIsEnabled(okButton));
    try {
        new WaitWhile(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
    } catch (WaitTimeoutExpiredException ex) {
        fail("Button Start All should be disabled at this point.");
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitWhile(new ControlIsEnabled(okButton), false);
    stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
    assertTrue("Button Stop All should be enabled at this point.", stopAllButton.isEnabled());
    stopAllButton.click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING);
    new WaitUntil(new ControlIsEnabled(okButton));
    try {
        new WaitUntil(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
    } catch (WaitTimeoutExpiredException ex) {
        fail("Button Start All should be enabled at this point.");
    }
    assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)73 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)48 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)45 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)43 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)37 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)32 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)32 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)22 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)17 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)15 Test (org.junit.Test)15 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)11 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)11 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)10 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)9 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)9 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)7 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)6 Shell (org.eclipse.reddeer.swt.api.Shell)6 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)6