Search in sources :

Example 36 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project jbosstools-openshift by jbosstools.

the class LinkToCreateNewProjectTest method createOpenShiftProjectViaLinkInExplorer.

@Test
public void createOpenShiftProjectViaLinkInExplorer() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    OpenShiftUtils.deleteAllProjects(connectionReq.getConnection());
    TreeItem connectionItem = explorer.getOpenShift3Connection(connectionReq.getConnection()).getTreeItem();
    TreeItem newProjectLinkItem = null;
    try {
        newProjectLinkItem = connectionItem.getItem("No projects are available. Click here to create a new project...");
    } catch (RedDeerException ex) {
        fail("There is no link to create a new project even connection does not have any project.");
    }
    TreeItemHandler.getInstance().click(newProjectLinkItem.getSWTWidget());
    try {
        new DefaultShell(OpenShiftLabel.Shell.CREATE_OS_PROJECT);
    } catch (RedDeerException ex) {
        fail("Create new OpenShift project shell has not been opened.");
    }
    new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText(projectName);
    new WaitUntil(new ControlIsEnabled(new FinishButton()));
    new FinishButton().click();
    projectCreated = true;
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.CREATE_OS_PROJECT), TimePeriod.LONG);
    assertTrue("OpenShift project is not visible in OpenShift Explorer under the connection" + " although it should have been created successfully and visible.", explorer.getOpenShift3Connection(connectionReq.getConnection()).projectExists(projectName));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) 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 37 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project jbosstools-openshift by jbosstools.

the class ProjectNameValidationTest method testShortProjectName.

@Test
public void testShortProjectName() {
    new LabeledText(OpenShiftLabel.TextLabels.PROJECT_NAME).setText("s");
    new DefaultText(PROJECT_NAME_SHORT_ERROR);
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 38 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project jbosstools-openshift by jbosstools.

the class DeployDockerImageTest method selectProjectAndVerifyDataProcessingInDeployToOpenShiftWizard.

/**
 * Selects a specified project and verify it is correctly processed in Deploy Image
 * to OpenShift wizard as well as processing of docker image details.
 *
 * @param projectName
 * @param projectDisplayName
 */
private void selectProjectAndVerifyDataProcessingInDeployToOpenShiftWizard(String projectName) {
    assertTrue("Wrong project has been preselected.", new LabeledCombo("OpenShift Project: ").getSelection().equals(projectName));
    assertTrue("Selected docker image should be used in wizard but it is not.", new LabeledText(OpenShiftLabel.TextLabels.IMAGE_NAME).getText().contains(HELLO_OS_DOCKER_IMAGE));
    assertTrue("Resource should be infered from image name but it is not", new LabeledText(OpenShiftLabel.TextLabels.RESOURCE_NAME).getText().contains(HELLO_OS_DOCKER_IMAGE.split("/")[2]));
}
Also used : LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText)

Example 39 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project jbosstools-openshift by jbosstools.

the class BuilderImageApplicationWizardHandlingTest method testResourceNameOnBuildConfigurationWizardPage.

@Test
public void testResourceNameOnBuildConfigurationWizardPage() {
    nextToBuildConfigurationWizardPage();
    LabeledText resourceName = new LabeledText(OpenShiftLabel.TextLabels.BUILDER_RESOURCE_NAME);
    String defaultName = "httpd";
    assertTrue("Resource name has not been inferred correctly.", resourceName.getText().equals(defaultName));
    validateInvalidResourceName("");
    validateInvalidResourceName(" ");
    validateInvalidResourceName("invAlid");
    validateValidResourceName("valid-name");
    validateInvalidResourceName("-invalid");
    validateValidResourceName("val1d-n4me-r3source");
    validateInvalidResourceName("invalid-");
    validateValidResourceName(defaultName);
}
Also used : LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) Test(org.junit.Test)

Example 40 with LabeledText

use of org.eclipse.reddeer.swt.impl.text.LabeledText in project jbosstools-openshift by jbosstools.

the class BuilderImageApplicationWizardHandlingTest method testGitFieldsValidationOnBuildConfigurationWizardPage.

@Test
public void testGitFieldsValidationOnBuildConfigurationWizardPage() {
    nextToBuildConfigurationWizardPage();
    LabeledText gitRepo = new LabeledText(OpenShiftLabel.TextLabels.GIT_REPO_URL);
    LabeledText gitReference = new LabeledText(OpenShiftLabel.TextLabels.GIT_REF);
    LabeledText contextDirectory = new LabeledText(OpenShiftLabel.TextLabels.CONTEXT_DIR);
    String defaultRepo = gitRepo.getText();
    String defaultRef = gitReference.getText();
    String defaultContextDir = contextDirectory.getText();
    validateGitRepoURL("invalid");
    validateGitRepoURL("");
    setDefaultValuesAndAssert(defaultRepo, defaultRef, defaultContextDir);
    gitReference.setText("");
    contextDirectory.setText("");
    assertTrue("Next button should be enabled if ref and context dir are empty.", new NextButton().isEnabled());
    assertTrue("Finish button should be enabled if ref and context dir are empty.", new FinishButton().isEnabled());
    setDefaultValuesAndAssert(defaultRepo, defaultRef, defaultContextDir);
    validateGitReference("invalid reference");
    validateGitReference("invalidad*reference");
    validateGitReference("invalid:reference");
    validateGitReference("@");
    validateGitReference("invalid\reference");
    setDefaultValuesAndAssert(defaultRepo, defaultRef, defaultContextDir);
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) Test(org.junit.Test)

Aggregations

LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)93 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)34 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)32 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)30 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)30 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)30 Test (org.junit.Test)29 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)25 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)23 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)19 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)18 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)14 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)11 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)11 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)10 RadioButton (org.eclipse.reddeer.swt.impl.button.RadioButton)9 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)9 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)8 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)8 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)8