Search in sources :

Example 11 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project linuxtools by eclipse.

the class RegistryAccountsPreferencePage method editRegistry.

public void editRegistry(String serverAddress, String email, String userName, String password) {
    Table table = new DefaultTable();
    if (table.containsItem(serverAddress)) {
        table.select(serverAddress);
        new PushButton("Edit").click();
        new LabeledText(SERVER_ADDRESS).setText(serverAddress);
        new LabeledText(USERNAME).setText(userName);
        new LabeledText(EMAIL).setText(email);
        new LabeledText(PASSWORD).setText(password);
        new PushButton("OK").click();
    }
}
Also used : DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) Table(org.eclipse.reddeer.swt.api.Table) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 12 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project linuxtools by eclipse.

the class RegistryAccountsPreferencePage method removeAllRegistries.

public void removeAllRegistries() {
    Table table = new DefaultTable();
    for (int i = 0; i < table.rowCount(); i++) {
        table.select(0);
        new PushButton("Remove").click();
    }
}
Also used : DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) Table(org.eclipse.reddeer.swt.api.Table) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 13 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable 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 14 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-openshift by jbosstools.

the class CreateApplicationOnBuilderImageTest method validateJBIDE22704.

private void validateJBIDE22704() {
    BuilderImageApplicationWizardHandlingTest.nextToBuildConfigurationWizardPage();
    applicationName = new LabeledText("Name: ").getText();
    assertNotNull(applicationName);
    assertTrue(applicationName.length() > 0);
    String gitUrl = new LabeledText("Git Repository URL:").getText();
    assertNotNull(gitUrl);
    if (gitUrl.length() < 1) {
        new CancelButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD));
        throw new OpenshiftTestInFailureException("JBIDE-23704 should be fixed now.");
    }
    new WaitUntil(new ControlIsEnabled(new NextButton()));
    /*
		 * switch to the Deployment page
		 */
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()));
    int numberofEnvironmentVariables = new DefaultTable().rowCount();
    assertTrue(numberofEnvironmentVariables > 0);
    /*
		 * switch to the Routing page
		 */
    new NextButton().click();
    new WaitUntil(new ControlIsEnabled(new BackButton()));
    int numberOfServicePorts = new DefaultTable().rowCount();
    assertTrue(numberOfServicePorts > 0);
    new CancelButton().click();
    new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(120));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OpenshiftTestInFailureException(org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException) NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) CancelButton(org.eclipse.reddeer.swt.impl.button.CancelButton) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) BackButton(org.eclipse.reddeer.swt.impl.button.BackButton) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 15 with DefaultTable

use of org.eclipse.reddeer.swt.impl.table.DefaultTable in project jbosstools-openshift by jbosstools.

the class TemplatesCreator method setTemplateParameters.

private void setTemplateParameters(TemplateParameter[] parameters) {
    for (TemplateParameter parameter : parameters) {
        new DefaultTable().select(parameter.getName());
        new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.EDIT)));
        new PushButton(OpenShiftLabel.Button.EDIT).click();
        new DefaultShell(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER);
        new DefaultText().setText(parameter.getValue());
        new WaitUntil(new ControlIsEnabled(new OkButton()));
        new OkButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_TEMPLATE_PARAMETER));
        new DefaultShell(OpenShiftLabel.Shell.NEW_APP_WIZARD);
    }
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Aggregations

DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)28 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)20 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)18 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)17 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)16 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)11 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)10 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)8 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)7 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)6 Test (org.junit.Test)6 Table (org.eclipse.reddeer.swt.api.Table)5 TableItem (org.eclipse.reddeer.swt.api.TableItem)5 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)3 DefaultText (org.eclipse.reddeer.swt.impl.text.DefaultText)3 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)3 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)3 BackButton (org.eclipse.reddeer.swt.impl.button.BackButton)2 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)2