Search in sources :

Example 1 with TemplatesAdministrationSectionPage

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();
}
Also used : LocalDocumentReference(org.xwiki.model.reference.LocalDocumentReference) TemplateProviderInlinePage(org.xwiki.administration.test.po.TemplateProviderInlinePage) TemplatesAdministrationSectionPage(org.xwiki.administration.test.po.TemplatesAdministrationSectionPage)

Aggregations

TemplateProviderInlinePage (org.xwiki.administration.test.po.TemplateProviderInlinePage)1 TemplatesAdministrationSectionPage (org.xwiki.administration.test.po.TemplatesAdministrationSectionPage)1 LocalDocumentReference (org.xwiki.model.reference.LocalDocumentReference)1