Search in sources :

Example 76 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class SecureStorage method handleSecureStoragePasswordAndHint.

public static void handleSecureStoragePasswordAndHint(String secureStoragePassword) {
    boolean firstStorage = provideSecureStoragePassword(secureStoragePassword);
    if (firstStorage) {
        // Did "Password hint needed" shell appear? Get rid of it.
        try {
            new DefaultShell(OpenShiftLabel.Shell.PASSWORD_HINT_NEEDED);
            new NoButton().click();
        } catch (CoreLayerException ex) {
            // do nothing
            LOGGER.debug("Password hint did not appear. Skipping.");
        }
    }
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) NoButton(org.eclipse.reddeer.swt.impl.button.NoButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 77 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class CreateServerAdapterTest method testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView.

@Test
public void testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).refresh();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getServicesWithName("eap-app").get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    assertTrue("Service should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(projectReq.getProjectName(), "eap-app deploymentConfig=eap-app").isSelected());
    assertTrue("Eclipse project should be preselected automatically for new server adapter", new LabeledText("Eclipse Project: ").getText().equals(PROJECT_NAME));
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(""));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
    assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, "eap-app", "Service").test());
}
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) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ServerAdapterExists(org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 78 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromTemplateTest method completeWizardAndVerify.

private void completeWizardAndVerify() {
    new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()), TimePeriod.LONG);
    String srcRepoRef = new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_REF).getText(1);
    srcRepoURI = new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_URL).getText(1);
    String contextDir = new DefaultTable().getItem(TemplateParametersTest.CONTEXT_DIR).getText(1);
    applicationName = new DefaultTable().getItem(TemplateParametersTest.APPLICATION_NAME).getText(1);
    new NextButton().click();
    new WaitWhile(new ControlIsEnabled(new NextButton()), TimePeriod.LONG);
    new FinishButton().click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.APPLICATION_SUMMARY), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    assertTrue(TemplateParametersTest.SOURCE_REPOSITORY_REF + " is not same as the one shown in " + "New OpenShift Application wizard.", new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_REF).getText(1).equals(srcRepoRef));
    assertTrue(TemplateParametersTest.SOURCE_REPOSITORY_URL.split(" ")[0] + " is not same as the one shown in " + "New OpenShift Application wizard.", new DefaultTable().getItem(TemplateParametersTest.SOURCE_REPOSITORY_URL.split(" ")[0]).getText(1).equals(srcRepoURI));
    assertTrue(TemplateParametersTest.CONTEXT_DIR + " is not same as the one shown in New OpenShift" + " Application wizard.", new DefaultTable().getItem(TemplateParametersTest.CONTEXT_DIR).getText(1).equals(contextDir));
    assertTrue(TemplateParametersTest.APPLICATION_NAME.split(" ")[0] + " is not same as the one shown in " + "New OpenShift Application wizard.", new DefaultTable().getItem(TemplateParametersTest.APPLICATION_NAME.split(" ")[0]).getText(1).equals(applicationName));
    assertFalse(TemplateParametersTest.GENERIC_SECRET.split(" ")[0] + " should be generated and non-empty.", new DefaultTable().getItem(TemplateParametersTest.GENERIC_SECRET.split(" ")[0]).getText(1).isEmpty());
    assertFalse(TemplateParametersTest.GITHUB_SECRET.split(" ")[0] + " should be generated and non-empty.", new DefaultTable().getItem(TemplateParametersTest.GITHUB_SECRET.split(" ")[0]).getText(1).isEmpty());
    new DefaultLink("Click here to display the webhooks available to automatically trigger builds.").click();
    new DefaultShell(OpenShiftLabel.Shell.WEBHOOK_TRIGGERS);
    genericWebhookURL = new DefaultText(0).getText();
    githubWebhookURL = new DefaultText(1).getText();
    assertFalse("Generic webhook URL should not be empty.", genericWebhookURL.isEmpty());
    assertFalse("GitHub webhook URL should not be empty.", githubWebhookURL.isEmpty());
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.WEBHOOK_TRIGGERS));
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_SUMMARY);
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultLink(org.eclipse.reddeer.swt.impl.link.DefaultLink) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 79 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class NodeJSAppDebugTest method setUp.

@Before
public void setUp() {
    TestUtils.setUpOcBinary();
    TestUtils.cleanupGitFolder(OpenShiftResources.NODEJS_GIT_NAME);
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.open();
    this.connection = explorer.getOpenShift3Connection(requiredConnection.getConnection());
    this.project = connection.getProject(requiredProject.getProjectName());
    this.project.expand();
    // import application
    this.project.getService(OpenShiftResources.NODEJS_SERVICE).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    // setup server adapter
    explorer.activate();
    this.project.getService(OpenShiftResources.NODEJS_SERVICE).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(""), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, OpenShiftResources.NODEJS_SERVICE, "Service").test());
    // restart in debug
    this.adapter = new ServerAdapter(Version.OPENSHIFT3, OpenShiftResources.NODEJS_SERVICE, "Service");
    this.adapter.select();
    new ContextMenuItem("Restart in Debug").select();
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ServerAdapter(org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter) 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) ServerAdapterExists(org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) Before(org.junit.Before)

Example 80 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class DebuggingEAPAppTest method setNewVariableValue.

// TODO this should be replaced once
// https://github.com/jboss-reddeer/reddeer/issues/1668 is fixed.
private void setNewVariableValue(String newValue, final String... variablePath) {
    new WaitWhile(new JobIsRunning());
    LaunchView debugView = new LaunchView();
    debugView.open();
    ensureCorrectFrameIsSelected(debugView);
    VariablesView variablesView = new VariablesView();
    variablesView.open();
    new WaitUntil(new AbstractWaitCondition() {

        @Override
        public boolean test() {
            try {
                TreeItem variable = new DefaultTreeItem(variablePath);
                variable.select();
                return variable.isSelected();
            } catch (Exception e) {
                return false;
            }
        }

        @Override
        public String description() {
            return "Variable is not selected";
        }
    }, TimePeriod.LONG);
    try {
        new ContextMenuItem("Change Value...").select();
    } catch (CoreLayerException e) {
        throw e;
    }
    new DefaultShell("Change Object Value");
    new DefaultStyledText().setText(newValue);
    new OkButton().click();
    new WaitWhile(new JobIsRunning());
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) CaptureScreenshotException(org.eclipse.reddeer.junit.screenshot.CaptureScreenshotException) IOException(java.io.IOException) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) LaunchView(org.eclipse.reddeer.eclipse.debug.ui.views.launch.LaunchView) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractWaitCondition(org.eclipse.reddeer.common.condition.AbstractWaitCondition) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) VariablesView(org.eclipse.reddeer.eclipse.debug.ui.views.variables.VariablesView)

Aggregations

DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)129 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)84 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)83 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)57 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)49 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)46 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)41 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)36 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)28 Test (org.junit.Test)27 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)25 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)18 Shell (org.eclipse.reddeer.swt.api.Shell)17 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)17 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)17 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)16 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)16 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)16 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)16