use of org.xwiki.officeimporter.test.po.OfficeImporterResultPage in project xwiki-platform by xwiki.
the class OfficeImporterTest method importFile.
/**
* Import an office file in the wiki.
*
* @param fileName name of the file to import (the file should be located in test /resources/ folder)
* @param splitByHeadings either the option splitByHeadings should be use or not
* @return the result page
*/
private ViewPage importFile(String fileName, boolean splitByHeadings) {
ViewPage page = getUtil().gotoPage(new DocumentReference("xwiki", Arrays.asList(getTestClassName(), getTestMethodName()), "WebHome"));
CreatePagePage createPage = page.createPage();
createPage.setType("office");
createPage.clickCreate();
OfficeImporterPage officeImporterPage = new OfficeImporterPage();
officeImporterPage.setFile(new File(getClass().getResource(fileName).getPath()));
officeImporterPage.setFilterStyle(true);
officeImporterPage.setSplitDocument(splitByHeadings);
OfficeImporterResultPage officeImporterResultPage = officeImporterPage.clickImport();
assertEquals("Conversion succeeded. You can view the result, or you can Go back to convert another document.", officeImporterResultPage.getMessage());
return officeImporterResultPage.viewResult();
}
Aggregations