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));
}
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);
}
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]));
}
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);
}
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);
}
Aggregations