use of org.eclipse.reddeer.swt.impl.button.OkButton 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.impl.button.OkButton 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());
}
use of org.eclipse.reddeer.swt.impl.button.OkButton in project jbosstools-openshift by jbosstools.
the class CDKServer method processProblemDialog.
private void processProblemDialog(Shell shell, String excMessage) {
log.info("Processing passed shell dialog " + new DefaultShell(shell).getText());
new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM, false);
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
DefaultShell shellDialog = new DefaultShell(shell);
log.info("Shell could have changed after getting another error");
log.info("Actual shell dialog name is " + shellDialog.getText());
CDKUtils.captureScreenshot("CDEServer#ProblemDialog#" + shellDialog.getText());
new OkButton(shellDialog).click();
throw new CDKServerException(excMessage);
}
use of org.eclipse.reddeer.swt.impl.button.OkButton in project jbosstools-openshift by jbosstools.
the class NewServerContainerWizardPage method setCredentials.
public void setCredentials(String username, String password) {
log.info("Setting Red Hat Access credentials");
getAddButton().click();
CredentialsWizardPage credentialsPage = new CredentialsWizardPage();
credentialsPage.setUsername(username);
credentialsPage.setPassword(password);
Button ok = new OkButton();
if (ok.isEnabled()) {
ok.click();
} else {
String text = credentialsPage.getDescriptionText().getText();
if (text.length() > 0) {
log.info("Adding new credential failed to add new user " + username);
log.info("There is an error while setting Red Hat Credentials: \r\n" + text);
}
if (text.contains("already exists for domain access.redhat.com")) {
credentialsPage.cancelAddingUser();
return;
}
throw new CoreLayerException("Setting the credentials was not successful, " + "OK button is not enabled, error: \n\r" + text);
}
// here might be placed code for disposal of secure storage
}
use of org.eclipse.reddeer.swt.impl.button.OkButton in project jbosstools-openshift by jbosstools.
the class OpenShift3ConnectionWizard method confirmMessageDialog.
private void confirmMessageDialog() {
ShellIsAvailable confirm = new ShellIsAvailable(OpenShiftLabel.Shell.OVERWRITE_REGISTRY_URL);
new WaitUntil(confirm, TimePeriod.MEDIUM);
DefaultShell dialog = new DefaultShell(OpenShiftLabel.Shell.OVERWRITE_REGISTRY_URL);
dialog.setFocus();
new OkButton().click();
new WaitWhile(confirm, TimePeriod.MEDIUM);
}
Aggregations