use of org.xwiki.administration.test.po.TemplatesAdministrationSectionPage in project xwiki-platform by xwiki.
the class CreatePageIT method createTemplateAndTemplateProvider.
/**
* Helper function to Create both a Template and a Template Provider for the tests in this class.
*/
private ViewPage createTemplateAndTemplateProvider(String templateProviderName, String templateContent, String templateTitle, boolean saveAndEdit) throws Exception {
// Cleanup of the test space for any leftovers from previous tests.
getUtil().deleteSpace(getTestClassName());
// Create a Template page
getUtil().rest().savePage(new LocalDocumentReference(getTestClassName(), TEMPLATE_NAME), templateContent, templateTitle);
// Create a Template Provider
TemplatesAdministrationSectionPage sectionPage = TemplatesAdministrationSectionPage.gotoPage();
TemplateProviderInlinePage templateProviderInline = sectionPage.createTemplateProvider(getTestClassName(), templateProviderName);
templateProviderInline.setTemplateName("Test Template");
templateProviderInline.setTemplate(getTestClassName() + "." + TEMPLATE_NAME);
if (saveAndEdit) {
templateProviderInline.setActionOnCreate(TemplateProviderInlinePage.ACTION_SAVEANDEDIT);
}
return templateProviderInline.clickSaveAndView();
}
Aggregations