Package net.sf.sahi.test

Examples of net.sf.sahi.test.SahiTestSuite


import net.sf.sahi.util.BrowserType;
import net.sf.sahi.util.BrowserTypesLoader;

public class Suite
  public void startSingleSession(final HttpRequest request) throws Exception {
    final SahiTestSuite suite = getSuite(request);
    suite.launchBrowserForSingleSession();
  }
View Full Code Here


    suite.launchBrowserForSingleSession();
  }
 
  public SimpleHttpResponse executeTestInSingleSession(final HttpRequest request) throws Exception {
    Session session = request.session();
    final SahiTestSuite suite = session.getSuite();
    String initJS = request.getParameter("initJS");
    System.out.println("Setting initJS" + initJS);
    suite.setInitJS(initJS);
    Status status = suite.executeTestForSingleSession(request.getParameter("testName"), request.getParameter("startURL"));
    return new SimpleHttpResponse(status.getName());
  }
View Full Code Here

    return new SimpleHttpResponse(status.getName());
  }
 
  public void stopSingleSession(final HttpRequest request) {
    Session session = request.session();
    final SahiTestSuite suite = session.getSuite();
    suite.killBrowserForSingleSession(true);
  }
View Full Code Here

    final SahiTestSuite suite = session.getSuite();
    suite.killBrowserForSingleSession(true);
  }
 
    public void start(final HttpRequest request) {
      final SahiTestSuite suite = getSuite(request);
      suite.loadScripts();
    runSuite(suite);
    }
View Full Code Here

      suite.loadScripts();
    runSuite(suite);
    }
   
    public void startPreconfiguredBrowser(final HttpRequest request){
      final SahiTestSuite suite = getPreconfiguredBrowserSuite(request);
      suite.loadScripts();
      runSuite(suite);
    }
View Full Code Here

        String browserOption = request.getParameter("browserOption");
        String browserProcessName = request.getParameter("browserProcessName");
        String threads = request.getParameter("threads");
        boolean isSingleSession = "true".equals(request.getParameter("useSingleSession"));
        boolean useSystemProxy = "true".equals(request.getParameter("useSystemProxy"));
        final SahiTestSuite suite = prepareSuite(suitePath, base, browser, session.id(), browserOption,
        browserProcessName, threads, useSystemProxy, isSingleSession, request);
    return suite;
  }
View Full Code Here

        browserProcessName, threads, useSystemProxy, isSingleSession, request);
    return suite;
  }
   
  private SahiTestSuite getPreconfiguredBrowserSuite(final HttpRequest request) {
    SahiTestSuite suite = null;
    BrowserTypesLoader browserLoader = new BrowserTypesLoader();
      BrowserType browserType = browserLoader.getBrowserType(request);
      Session session = request.session();
        String suitePath = request.getParameter("suite");
        String base = request.getParameter("base");
View Full Code Here

  }

  private SahiTestSuite prepareSuite(String suitePath, String base, String browser, String sessionId,
      String browserOption, String browserProcessName, String threadCapacity, boolean useSystemProxy,
      boolean isSingleSession, HttpRequest request) {
    final SahiTestSuite suite = new SahiTestSuite(net.sf.sahi.config.Configuration.getAbsoluteUserPath(suitePath),
        base, browser, sessionId, browserOption, browserProcessName, isSingleSession);
    int threads = 1;
    try {
      threads = Integer.parseInt(threadCapacity);
    } catch (Exception e) {}
    suite.setAvailableThreads(threads);
    suite.setUseSystemProxy(useSystemProxy);
    try {
      net.sf.sahi.config.Configuration.copyProfiles();
    } catch (IOException e) {
      e.printStackTrace();
    }
    suite.setExtraInfo(request.getParameter("extraInfo"));
    suite.setInitJS(request.getParameter("initJS"));
    setReporters(suite, request);
    setIssueCreators(suite, request);
    return suite;
  }
View Full Code Here

    return logDir.equals("") ? defaultLogDir : net.sf.sahi.config.Configuration.getAbsoluteUserPath(logDir);
  }

    public void kill(final HttpRequest request) {
        Session session = request.session();
        SahiTestSuite suite = SahiTestSuite.getSuite(session.id());
        if (suite != null) suite.kill();
    }
View Full Code Here

        String name = request.getParameter("name");
        String value = request.getParameter("value");
        boolean append = "1".equals(request.getParameter("append"));
        Hits.increment("SessionState_setVar :: " + name);
        if (setVarOnSuite(request)){
          SahiTestSuite suite = request.session().getSuite();
          if (append) {
            String val = suite.getVariable(name);
            if (val != null) value = val + " + " + value;
          }
      suite.setVariable(name, value);
        } else {
          if (append) {
            String val = session.getVariable(name);
            if (val != null) value = val + " + " + value;
          }
View Full Code Here

TOP

Related Classes of net.sf.sahi.test.SahiTestSuite

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.