use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class CDK32ServerWizardTest method testNewCDK32ServerWizard.
@Test
public void testNewCDK32ServerWizard() {
NewCDKServerWizard dialog = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
NewServerWizardPage page = new NewServerWizardPage(dialog);
page.selectType(SERVER_TYPE_GROUP, CDK32_SERVER_NAME);
page.setName(getServerAdapter());
dialog.next();
NewCDK32ServerWizardPage containerPage = new NewCDK32ServerWizardPage();
checkWizardPagewidget("Minishift Binary: ", CDK32_SERVER_NAME);
// just check that default domain is choosen correctly
assertTrue(containerPage.getDomain().equalsIgnoreCase(CREDENTIALS_DOMAIN));
assertTrue(containerPage.getMinishiftProfile().getText().equals("minishift"));
// needs to activate validator
containerPage.setMinishiftBinary(EXISTING_PATH);
// first the credentials are checked
assertSameMessage(dialog, NO_USER);
containerPage.setCredentials(USERNAME, PASSWORD);
assertDiffMessage(dialog, NO_USER);
// checking of minishift binary validation
// test that existing folder cannot be run
containerPage.setMinishiftBinary(EXISTING_PATH);
assertSameMessage(dialog, CANNOT_RUN_PROGRAM);
containerPage.setMinishiftBinary(NON_EXECUTABLE_FILE);
assertSameMessage(dialog, NOT_EXECUTABLE);
containerPage.setMinishiftBinary(NON_EXISTING_PATH);
assertSameMessage(dialog, DOES_NOT_EXIST);
containerPage.setMinishiftBinary(EXECUTABLE_FILE);
assertSameMessage(dialog, CHECK_MINISHIFT_VERSION);
// check compatibility of cdk version with server adapter
containerPage.setMinishiftBinary(MOCK_CDK311);
assertSameMessage(dialog, NOT_COMPATIBLE);
// Positive test of proper minishift binary
containerPage.setMinishiftBinary(CDK32_MINISHIFT);
assertDiffMessage(dialog, CHECK_MINISHIFT_VERSION);
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.MEDIUM, false);
assertTrue("Expected Finish button is not enabled", dialog.isFinishEnabled());
dialog.cancel();
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class CreateApplicationFromTemplateTest method importTestsProject.
@BeforeClass
public static void importTestsProject() {
new ExternalProjectImportWizardDialog().open();
new DefaultCombo().setText(TESTS_PROJECT_LOCATION);
new PushButton("Refresh").click();
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.LONG);
new FinishButton().click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new ProjectExists(TESTS_PROJECT), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled 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();
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled 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));
}
use of org.eclipse.reddeer.swt.condition.ControlIsEnabled in project jbosstools-openshift by jbosstools.
the class OpenShift3ConnectionWizard method finish.
/**
* Waits and clicks Finish button .
*/
public void finish() {
new WaitUntil(new ControlIsEnabled(new FinishButton()), TimePeriod.LONG);
new FinishButton().click();
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
// check for Wizard closing dialog
try {
new WaitUntil(new ShellIsAvailable("Wizard closing"), TimePeriod.MEDIUM);
new OkButton().click();
new WaitWhile(new ShellIsAvailable("Wizard closing"), TimePeriod.MEDIUM, false);
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
new FinishButton().click();
} catch (WaitTimeoutExpiredException exc) {
// dialog not shown, continue
}
waitForShellToClose(getShell());
}
Aggregations