Package er.selenium.io

Examples of er.selenium.io.SeleniumTestImporter


  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);
View Full Code Here


      if (fname.startsWith("_")) {
        log.debug("Ignoring " + fname + " because of the starting _");
        continue;
      }
      String extension = "." + ERXFileUtilities.fileExtension(fname);
      SeleniumTestImporter importer = SeleniumImporterExporterFactory.instance().findImporterByExtension(extension);
      if (importer != null) {
        result.add(file);
        log.debug("Test file '" + file.getName() + "' of type '" + importer.name() + "'");
      } else {
        log.debug("Can't find importer for extension '" + extension + "' for file '" + file.getName() + "'");
      }
    }
   
View Full Code Here

  }
 
  public SeleniumTest process() {
    String extension = "." + ERXFileUtilities.fileExtension(testFile.getName());
   
    SeleniumTestImporter importer = SeleniumImporterExporterFactory.instance().findImporterByExtension(extension);
    if (importer == null) {
      throw new RuntimeException("Can't process '" + testFile.getAbsolutePath() + "': unsupported file type ('" + extension + "')");
    }
   
      try {
        String fileContents = ERXFileUtilities.stringFromFile(testFile, CharEncoding.UTF_8);
        SeleniumTest result = importer.process(fileContents);
        if (filter != null) {
          result = filter.processTest(result);
        }
        return result;
      } catch (Exception e) {
View Full Code Here

TOP

Related Classes of er.selenium.io.SeleniumTestImporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.