public SeleniumIncludeTestFilter(NSArray<File> searchPaths) {
_searchPaths = searchPaths;
}
protected NSArray<SeleniumTest.Element> getIncludedArguments(String name) {
SeleniumTestImporter importer = SeleniumImporterExporterFactory.instance().findImporterByExtension('.' + ERXFileUtilities.fileExtension(name));
if (importer == null) {
throw new RuntimeException("Can't find importer for included test file: " + name);
}
for (File sp : _searchPaths) {
File fio = new File(sp.getAbsolutePath() + "/" + name);
if (fio.exists()) {
String fileContents;
try {
fileContents = ERXFileUtilities.stringFromFile(fio, CharEncoding.UTF_8);
} catch (IOException e) {
log.error("Can't read " + fio.getAbsolutePath() + " contents");
throw new RuntimeException(e);
}
SeleniumTest processedTest = importer.process(fileContents);
return processedTest.elements();
}
}
throw new RuntimeException("Included path not found: " + name);