// we'll create all these pages during this test
getUtil().deletePage(space, "NewUnexistingPage");
getUtil().deletePage(space, "NewPage");
getUtil().deletePage(space, "NewLinkedPage");
// go through all the templates and make sure they are disabled on this space
TemplatesAdministrationSectionPage sectionPage = TemplatesAdministrationSectionPage.gotoPage();
// get the links to existing templates, navigate to each of them and disable the current space
List<String> spacesToExclude = Collections.singletonList(space);
List<WebElement> existingTemplatesLinks = sectionPage.getExistingTemplatesLinks();
for (int i = 0; i < existingTemplatesLinks.size(); i++) {
WebElement link = existingTemplatesLinks.get(i);
link.click();
ViewPage templateViewPage = new ViewPage();
templateViewPage.editInline();
TemplateProviderInlinePage providerEditPage = new TemplateProviderInlinePage();
if (providerEditPage.isPageTemplate()) {
providerEditPage.excludeSpaces(spacesToExclude);
providerEditPage.clickSaveAndView();
}
// go back to the admin page, to leave this in a valid state
sectionPage = TemplatesAdministrationSectionPage.gotoPage();
existingTemplatesLinks = sectionPage.getExistingTemplatesLinks();
}
// TODO: should reset these template settings at the end of the test, to leave things in the same state as they
// were at the beginning of the test