Search in sources :

Example 1 with CancelButton

use of org.eclipse.reddeer.swt.impl.button.CancelButton in project linuxtools by eclipse.

the class SearchDialogTest method testSearchDialog.

@Test
public void testSearchDialog() {
    DockerExplorerView explorer = new DockerExplorerView();
    getConnection().openImageSearchDialog(IMAGE_NAME, null, REGISTRY_URL);
    ImageSearchPage pageOne = new ImageSearchPage(explorer);
    pageOne.searchImage();
    assertFalse("Search result is empty!", pageOne.getSearchResults().isEmpty());
    assertTrue("Search result do not contains image:" + EXPECTED_IMAGE_NAME + "!", pageOne.searchResultsContains(EXPECTED_IMAGE_NAME));
    pageOne.next();
    // new WaitUntil(new ShellIsAvailable("Progress Information"), TimePeriod.DEFAULT);
    AbstractWait.sleep(TimePeriod.getCustom(5));
    ImageTagSelectionPage pageTwo = new ImageTagSelectionPage(pageOne);
    assertFalse("Search tags are empty!", pageTwo.getTags().isEmpty());
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    if (!pageTwo.tagsContains(IMAGE_TAG)) {
        pageTwo.cancel();
        new CancelButton().click();
        fail("Search results do not contain tag: " + IMAGE_TAG + "!");
    }
    pageTwo.selectTag(IMAGE_TAG);
    pageTwo.finish();
    new PushButton("Finish").click();
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : DockerExplorerView(org.eclipse.linuxtools.docker.reddeer.ui.DockerExplorerView) ImageSearchPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageSearchPage) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ImageTagSelectionPage(org.eclipse.linuxtools.docker.reddeer.core.ui.wizards.ImageTagSelectionPage) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Test(org.junit.Test) AbstractImageBotTest(org.eclipse.linuxtools.docker.integration.tests.image.AbstractImageBotTest)

Example 2 with CancelButton

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

the class ServerAdapterWizardHandlingTest method closeShell.

@After
public void closeShell() {
    Shell shell = ShellLookup.getInstance().getShell(OpenShiftLabel.Shell.ADAPTER);
    if (shell != null) {
        new DefaultShell(OpenShiftLabel.Shell.ADAPTER);
        new CancelButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.ADAPTER));
    }
    new WaitWhile(new JobIsRunning());
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.swt.widgets.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) After(org.junit.After)

Example 3 with CancelButton

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

the class ConnectionWizardHandlingTest method closeNewConnectionShell.

@After
public void closeNewConnectionShell() {
    new CancelButton().click();
    new WaitWhile(new ShellIsAvailable(""));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) After(org.junit.After)

Example 4 with CancelButton

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

the class CDKServerWizardAbstractTest method assertServerType.

protected void assertServerType(final String serverType) {
    NewCDKServerWizard wizard = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
    try {
        TreeItem item = new DefaultTreeItem(new String[] { SERVER_TYPE_GROUP }).getItem(serverType);
        item.select();
        assertTrue(item.getText().equalsIgnoreCase(serverType));
        new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
    } catch (CoreLayerException coreExp) {
        log.error(coreExp.getMessage());
        fail("Server type " + serverType + " was not found in New Server Wizard");
    }
    assertEquals(new LabeledText("Server's host name:").getText(), "localhost");
    assertEquals(new LabeledText("Server name:").getText(), getServerAdapter());
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.MEDIUM, false);
    assertTrue("Dialog button Next is not enabled!", wizard.isNextEnabled());
    try {
        new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
        new CancelButton().click();
    } catch (WaitTimeoutExpiredException exc) {
        exc.printStackTrace();
        log.error("Dialog could not be canceled because there were unfinished jobs running after timeout" + "\n\rTrying to cancel dialog manually");
        new DefaultShell("New Server").close();
    }
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) SystemJobIsRunning(org.jboss.tools.cdk.reddeer.core.condition.SystemJobIsRunning) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) NewCDKServerWizard(org.jboss.tools.cdk.reddeer.server.ui.wizard.NewCDKServerWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 5 with CancelButton

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

the class CreateApplicationFromTemplateTest method createApplicationFromLocalWorkspaceTemplate.

@Test
public void createApplicationFromLocalWorkspaceTemplate() {
    new NewOpenShift3ApplicationWizard(connectionReq.getConnection()).openWizardFromExplorer(DatastoreOS3.PROJECT1_DISPLAYED_NAME);
    new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
    new PushButton(OpenShiftLabel.Button.BROWSE_WORKSPACE).click();
    new DefaultShell(OpenShiftLabel.Shell.SELECT_OPENSHIFT_TEMPLATE);
    new DefaultTreeItem(TESTS_PROJECT, "eap64-basic-s2i.json").select();
    new OkButton().click();
    new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    assertTrue("Template from workspace is not correctly shown in text field containing its path", new LabeledText(OpenShiftLabel.TextLabels.SELECT_LOCAL_TEMPLATE).getText().equals("${workspace_loc:" + File.separator + TESTS_PROJECT + File.separator + "eap64-basic-s2i.json}"));
    new WaitUntil(new ControlIsEnabled(new CancelButton()));
    // TODO: Remove comment once JBIDE-24492 is resolved
    // assertTrue("Defined resource button should be enabled",
    // new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).isEnabled());
    completeApplicationCreationAndVerify(helloworldProject);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) NewOpenShift3ApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.v3.NewOpenShift3ApplicationWizard) 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) TemplateParametersTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.TemplateParametersTest)

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