Search in sources :

Example 6 with DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem in project linuxtools by eclipse.

the class DockerConnection method enableConnection.

public void enableConnection() {
    select();
    new DefaultToolItem("Enable Connection").click();
    new WaitWhile(new JobIsRunning());
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 7 with DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem in project jbosstools-hibernate by jbosstools.

the class HQLEditor method runHQLQuery.

/**
 * Executes HQL query
 */
public void runHQLQuery() {
    new DefaultToolItem("Run HQL").click();
    try {
        Shell s = new DefaultShell("Open Session factory");
        new YesButton(s).click();
        new WaitWhile(new ShellIsAvailable(s));
    } catch (WaitTimeoutExpiredException e) {
        log.warn("Open Session factory question dialog was expected");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 8 with DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem in project jbosstools-openshift by jbosstools.

the class OpenNewConnectionWizardTest method shouldOpenConnectionWizardViaToolItemTest.

@Test
public void shouldOpenConnectionWizardViaToolItemTest() {
    // given
    explorer.open();
    // when
    new DefaultToolItem(OpenShiftLabel.Others.CONNECT_TOOL_ITEM).click();
    // then
    verifyNewConnectionWizardIsOpened();
}
Also used : DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 9 with DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem in project jbosstools-openshift by jbosstools.

the class OpenNewApplicationWizardWithNoProjectTest method testOpenNewApplicationWizardFromCentralWithNoProjects.

@Test
public void testOpenNewApplicationWizardFromCentralWithNoProjects() {
    new DefaultToolItem(new WorkbenchShell(), OpenShiftLabel.Others.RED_HAT_CENTRAL).click();
    new InternalBrowser().execute(OpenShiftLabel.Others.OPENSHIFT_CENTRAL_SCRIPT);
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    for (String comboItem : new DefaultCombo(0).getItems()) {
        if (comboItem.contains(connectionReq.getUsername()) && comboItem.contains(connectionReq.getHost())) {
            new DefaultCombo(0).setSelection(comboItem);
            break;
        }
    }
    new NextButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
    new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(projectName);
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    assertTrue("Created project was not preselected for a new OpenShift application", new LabeledCombo(OpenShiftLabel.TextLabels.PROJECT).getText().equals(projectName));
    closeWizard();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) InternalBrowser(org.eclipse.reddeer.swt.impl.browser.InternalBrowser) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Test(org.junit.Test)

Example 10 with DefaultToolItem

use of org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem in project jbosstools-openshift by jbosstools.

the class GetOpenShiftIOTokenTest method testGetToken.

@Test
public void testGetToken() {
    new DefaultToolItem(new WorkbenchShell(), "Connect to OpenShift.io").click();
    DefaultShell browser = new DefaultShell();
    InternalBrowser internalBrowser = new InternalBrowser(browser);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new BrowserContainsText("OpenShift.io Developer Preview"), TimePeriod.LONG);
    internalBrowser.execute(String.format("document.getElementById(\"username\").value=\"%s\"", DatastoreOS3.OPENSHIFT_IO_USERNAME));
    internalBrowser.execute(String.format("document.getElementById(\"password\").value=\"%s\"", DatastoreOS3.OPENSHIFT_IO_PASSWORD));
    internalBrowser.execute("document.getElementById(\"password\").parentElement.parentElement.parentElement.submit()");
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    try {
        new DefaultShell("OpenShift.io");
    } catch (CoreLayerException ex) {
        // Secure storage has been triggered
        SecureStorage.handleSecureStoragePasswordAndHint(SystemProperties.SECURE_STORAGE_PASSWORD);
        new DefaultShell("OpenShift.io");
    }
    new OkButton().click();
    checkAccountInProperties();
    checkPluginInSecureStorage();
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) InternalBrowser(org.eclipse.reddeer.swt.impl.browser.InternalBrowser) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) BrowserContainsText(org.jboss.tools.openshift.reddeer.condition.BrowserContainsText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

DefaultToolItem (org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)20 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)9 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)9 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)8 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)8 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)6 WorkbenchShell (org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell)5 InternalBrowser (org.eclipse.reddeer.swt.impl.browser.InternalBrowser)4 Test (org.junit.Test)4 Shell (org.eclipse.reddeer.swt.api.Shell)3 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)3 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)3 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)3 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)2 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)2 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)2 CentralIsLoaded (org.jboss.tools.openshift.reddeer.condition.CentralIsLoaded)2 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)2 File (java.io.File)1 IOException (java.io.IOException)1