use of io.fabric8.openshift.api.model.Project in project fabric8 by fabric8io.
the class ProjectsPage method createProject.
/**
* Creates a new project using the create projects wizard and asserts it appears on the projects page
*/
public void createProject(NewProjectFormData form) {
goToProjectsPage();
WebDriverFacade facade = getFacade();
facade.untilLinkClicked(createProjectBy);
By nextButton = By.xpath("//button[@ng-click='execute()']");
// it can take a while to load pages in the wizard to lets increase the wait time lots! :)
facade.setDefaultTimeoutInSeconds(60 * 9);
String named = form.getNamed();
facade.form().clearAndSendKeys(By.xpath("//input[@ng-model='entity.named']"), named).submitButton(nextButton).submit();
facade.form().completeComboBox(By.xpath("//label[text() = 'Archetype']/following::input[@type='text']"), form.getArchetypeFilter()).submitButton(nextButton).submit();
untilNextWizardPage(facade, nextButton);
facade.form().submitButton(nextButton).submit();
untilNextWizardPage(facade, nextButton);
facade.form().completeComboBox(By.xpath("//label[text() = 'Flow']/following::input[@type='text']"), form.getJenkinsFileFilter()).submitButton(nextButton).submit();
facade.untilIsDisplayed(By.xpath("//a[@href='/forge/repos' and text()='Done']"));
logInfo("Created project: " + named);
goToProjectsPage();
// lets assert there's a link to the project page
facade.untilIsDisplayed(By.partialLinkText(named));
}
use of io.fabric8.openshift.api.model.Project in project fabric8 by fabric8io.
the class Example method main.
public static void main(String[] args) {
String projectName = "admin-beer";
if (args.length > 0) {
projectName = args[0];
}
try {
KubernetesClient kubernetes = new DefaultKubernetesClient();
TaigaClient taiga = TaigaKubernetes.createTaiga(kubernetes, KubernetesHelper.defaultNamespace());
System.out.println("Connecting to taiga on: " + taiga.getAddress());
ProjectDTO myProject = taiga.getProjectBySlug(projectName);
System.out.println("Found project: " + myProject + " by slug: " + projectName);
System.out.println("Project id for slug: " + myProject + " is: " + taiga.getProjectIdForSlug(projectName));
ProjectDTO notExist = taiga.getProjectBySlug("does-not-exist");
System.out.println("Found non existing project: " + notExist);
Map<String, ModuleDTO> modules = taiga.getModulesForProject(projectName);
System.out.println("Available modules for " + projectName + " are: " + modules.keySet());
// lets try find the module for gogs
ModuleDTO gogsModule = taiga.moduleForProject(projectName, TaigaModule.GOGS);
System.out.println("Gogs module for " + projectName + " is " + gogsModule);
ProjectDTO autoCreateProject = taiga.getOrCreateProject("thingy");
System.out.println("getOrCreateProject: " + autoCreateProject);
List<ProjectDTO> projects = taiga.getProjects();
for (ProjectDTO project : projects) {
System.out.println("Project " + project.getId() + " has slug: " + project.getSlug() + " name " + project.getName());
}
} catch (Exception e) {
System.out.println("Caught: " + e);
e.printStackTrace();
}
}
Aggregations