Example #1
0
    def buildURLOptions(self, options, env):
        """ Add test control options from the command line to the url 

        URL parameters to test URL:

        autorun -- kick off tests automatically
        closeWhenDone -- closes the browser after the tests
        hideResultsTable -- hides the table of individual test results
        logFile -- logs test run to an absolute path
        totalChunks -- how many chunks to split tests into
        thisChunk -- which chunk to run
        timeout -- per-test timeout in seconds
        repeat -- How many times to repeat the test, ie: repeat=1 will run the test twice.
    """

        # allow relative paths for logFile
        if options.logFile:
            options.logFile = self.getLogFilePath(options.logFile)
        if options.browserChrome or options.chrome or options.a11y:
            self.makeTestConfig(options)
        else:
            if options.autorun:
                self.urlOpts.append("autorun=1")
            if options.timeout:
                self.urlOpts.append("timeout=%d" % options.timeout)
            if options.closeWhenDone:
                self.urlOpts.append("closeWhenDone=1")
            if options.logFile:
                self.urlOpts.append("logFile=" +
                                    encodeURIComponent(options.logFile))
                self.urlOpts.append("fileLevel=" +
                                    encodeURIComponent(options.fileLevel))
            if options.consoleLevel:
                self.urlOpts.append("consoleLevel=" +
                                    encodeURIComponent(options.consoleLevel))
            if options.totalChunks:
                self.urlOpts.append("totalChunks=%d" % options.totalChunks)
                self.urlOpts.append("thisChunk=%d" % options.thisChunk)
            if options.chunkByDir:
                self.urlOpts.append("chunkByDir=%d" % options.chunkByDir)
            if options.shuffle:
                self.urlOpts.append("shuffle=1")
            if "MOZ_HIDE_RESULTS_TABLE" in env and env[
                    "MOZ_HIDE_RESULTS_TABLE"] == "1":
                self.urlOpts.append("hideResultsTable=1")
            if options.repeat:
                self.urlOpts.append("repeat=%d" % options.repeat)
            if os.path.isfile(
                    os.path.join(self.oldcwd, os.path.dirname(__file__),
                                 self.TEST_PATH,
                                 options.testPath)) and options.repeat > 0:
                self.urlOpts.append(
                    "testname=%s" %
                    ("/").join([self.TEST_PATH, options.testPath]))
            if options.runOnlyTests:
                self.urlOpts.append("runOnlyTests=%s" % options.runOnlyTests)
            if options.failureFile:
                self.urlOpts.append("failureFile=%s" % options.failureFile)
            elif options.excludeTests:
                self.urlOpts.append("excludeTests=%s" % options.excludeTests)
Example #2
0
    def buildURLOptions(self, options, env):
        """ Add test control options from the command line to the url 

        URL parameters to test URL:

        autorun -- kick off tests automatically
        closeWhenDone -- closes the browser after the tests
        hideResultsTable -- hides the table of individual test results
        logFile -- logs test run to an absolute path
        totalChunks -- how many chunks to split tests into
        thisChunk -- which chunk to run
        timeout -- per-test timeout in seconds
        repeat -- How many times to repeat the test, ie: repeat=1 will run the test twice.
    """

        # allow relative paths for logFile
        if options.logFile:
            options.logFile = self.getLogFilePath(options.logFile)
        if options.browserChrome or options.chrome or options.a11y or options.webapprtChrome:
            self.makeTestConfig(options)
        else:
            if options.autorun:
                self.urlOpts.append("autorun=1")
            if options.timeout:
                self.urlOpts.append("timeout=%d" % options.timeout)
            if options.closeWhenDone:
                self.urlOpts.append("closeWhenDone=1")
            if options.logFile:
                self.urlOpts.append("logFile=" + encodeURIComponent(options.logFile))
                self.urlOpts.append("fileLevel=" + encodeURIComponent(options.fileLevel))
            if options.consoleLevel:
                self.urlOpts.append("consoleLevel=" + encodeURIComponent(options.consoleLevel))
            if options.totalChunks:
                self.urlOpts.append("totalChunks=%d" % options.totalChunks)
                self.urlOpts.append("thisChunk=%d" % options.thisChunk)
            if options.chunkByDir:
                self.urlOpts.append("chunkByDir=%d" % options.chunkByDir)
            if options.shuffle:
                self.urlOpts.append("shuffle=1")
            if "MOZ_HIDE_RESULTS_TABLE" in env and env["MOZ_HIDE_RESULTS_TABLE"] == "1":
                self.urlOpts.append("hideResultsTable=1")
            if options.runUntilFailure:
                self.urlOpts.append("runUntilFailure=1")
            if options.repeat:
                self.urlOpts.append("repeat=%d" % options.repeat)
            if (
                os.path.isfile(os.path.join(self.oldcwd, os.path.dirname(__file__), self.TEST_PATH, options.testPath))
                and options.repeat > 0
            ):
                self.urlOpts.append("testname=%s" % ("/").join([self.TEST_PATH, options.testPath]))
            if options.testManifest:
                self.urlOpts.append("testManifest=%s" % options.testManifest)
                if hasattr(options, "runOnly") and options.runOnly:
                    self.urlOpts.append("runOnly=true")
                else:
                    self.urlOpts.append("runOnly=false")
            if options.failureFile:
                self.urlOpts.append("failureFile=%s" % self.getFullPath(options.failureFile))
            if options.runSlower:
                self.urlOpts.append("runSlower=true")
Example #3
0
    def buildURLOptions(self, options, env):
        """ Add test control options from the command line to the url 

        URL parameters to test URL:

        autorun -- kick off tests automatically
        closeWhenDone -- runs quit.js after tests
        hideResultsTable -- hides the table of individual test results
        logFile -- logs test run to an absolute path
        totalChunks -- how many chunks to split tests into
        thisChunk -- which chunk to run
        timeout -- per-test timeout in seconds
        loops -- How many times to run the test
    """

        # allow relative paths for logFile
        if options.logFile:
            options.logFile = self.getLogFilePath(options.logFile)
        if options.browserChrome or options.chrome or options.a11y:
            self.makeTestConfig(options)
        else:
            if options.autorun:
                self.urlOpts.append("autorun=1")
            if options.timeout:
                self.urlOpts.append("timeout=%d" % options.timeout)
            if options.closeWhenDone:
                self.urlOpts.append("closeWhenDone=1")
            if options.logFile:
                self.urlOpts.append("logFile=" +
                                    encodeURIComponent(options.logFile))
                self.urlOpts.append("fileLevel=" +
                                    encodeURIComponent(options.fileLevel))
            if options.consoleLevel:
                self.urlOpts.append("consoleLevel=" +
                                    encodeURIComponent(options.consoleLevel))
            if options.totalChunks:
                self.urlOpts.append("totalChunks=%d" % options.totalChunks)
                self.urlOpts.append("thisChunk=%d" % options.thisChunk)
            if options.chunkByDir:
                self.urlOpts.append("chunkByDir=%d" % options.chunkByDir)
            if options.shuffle:
                self.urlOpts.append("shuffle=1")
            if "MOZ_HIDE_RESULTS_TABLE" in env and env[
                    "MOZ_HIDE_RESULTS_TABLE"] == "1":
                self.urlOpts.append("hideResultsTable=1")
            if options.loops:
                self.urlOpts.append("loops=%d" % options.loops)
            if os.path.isfile(self.oldcwd + self.TEST_PATH +
                              options.testPath) and options.loops > 0:
                self.urlOpts.append("testname=%s" %
                                    (self.TEST_PATH + options.testPath))
Example #4
0
 def buildTestPath(self, options):
   """ Build the url path to the specific test harness and test file or directory """
   testHost = "http://mochi.test:8888"
   testURL = testHost + self.TEST_PATH + options.testPath
   if options.chrome:
     testURL = testHost + self.CHROME_PATH
     if options.testPath:
       self.urlOpts.append("testPath=" + encodeURIComponent(options.testPath))
   elif options.a11y:
     testURL = testHost + self.A11Y_PATH
     if options.testPath:
       self.urlOpts.append("testPath=" + encodeURIComponent(options.testPath))
   elif options.browserChrome:
     testURL = "about:blank"
   return testURL
Example #5
0
 def buildTestPath(self, options):
     """ Build the url path to the specific test harness and test file or directory """
     testHost = "http://mochi.test:8888"
     testURL = testHost + self.TEST_PATH + options.testPath
     if options.chrome:
         testURL = testHost + self.CHROME_PATH
         if options.testPath:
             self.urlOpts.append("testPath=" +
                                 encodeURIComponent(options.testPath))
     elif options.a11y:
         testURL = testHost + self.A11Y_PATH
         if options.testPath:
             self.urlOpts.append("testPath=" +
                                 encodeURIComponent(options.testPath))
     elif options.browserChrome:
         testURL = "about:blank"
     return testURL
Example #6
0
  def buildURLOptions(self, options, env):
    """ Add test control options from the command line to the url 

        URL parameters to test URL:

        autorun -- kick off tests automatically
        closeWhenDone -- runs quit.js after tests
        hideResultsTable -- hides the table of individual test results
        logFile -- logs test run to an absolute path
        totalChunks -- how many chunks to split tests into
        thisChunk -- which chunk to run
        timeout -- per-test timeout in seconds
        loops -- How many times to run the test
    """
  
    # allow relative paths for logFile
    if options.logFile:
      options.logFile = self.getLogFilePath(options.logFile)
    if options.browserChrome or options.chrome or options.a11y:
      self.makeTestConfig(options)
    else:
      if options.autorun:
        self.urlOpts.append("autorun=1")
      if options.timeout:
        self.urlOpts.append("timeout=%d" % options.timeout)
      if options.closeWhenDone:
        self.urlOpts.append("closeWhenDone=1")
      if options.logFile:
        self.urlOpts.append("logFile=" + encodeURIComponent(options.logFile))
        self.urlOpts.append("fileLevel=" + encodeURIComponent(options.fileLevel))
      if options.consoleLevel:
        self.urlOpts.append("consoleLevel=" + encodeURIComponent(options.consoleLevel))
      if options.totalChunks:
        self.urlOpts.append("totalChunks=%d" % options.totalChunks)
        self.urlOpts.append("thisChunk=%d" % options.thisChunk)
      if options.chunkByDir:
        self.urlOpts.append("chunkByDir=%d" % options.chunkByDir)
      if options.shuffle:
        self.urlOpts.append("shuffle=1")
      if "MOZ_HIDE_RESULTS_TABLE" in env and env["MOZ_HIDE_RESULTS_TABLE"] == "1":
        self.urlOpts.append("hideResultsTable=1")
      if options.loops:
        self.urlOpts.append("loops=%d" % options.loops)
      if os.path.isfile(self.oldcwd + self.TEST_PATH + options.testPath) and options.loops > 0:
        self.urlOpts.append("testname=%s" % (self.TEST_PATH + options.testPath))
Example #7
0
    def buildURLOptions(self, options):
        """ Add test control options from the command line to the url 

        URL parameters to test URL:

        autorun -- kick off tests automatically
        closeWhenDone -- runs quit.js after tests
        logFile -- logs test run to an absolute path
        totalChunks -- how many chunks to split tests into
        thisChunk -- which chunk to run
        timeout -- per-test timeout in seconds
    """

        # allow relative paths for logFile
        if options.logFile:
            options.logFile = self.getLogFilePath(options.logFile)
        if options.browserChrome:
            self.makeTestConfig(options)
        else:
            if options.autorun:
                self.urlOpts.append("autorun=1")
            if options.timeout:
                self.urlOpts.append("timeout=%d" % options.timeout)
            if options.closeWhenDone:
                self.urlOpts.append("closeWhenDone=1")
            if options.logFile:
                self.urlOpts.append("logFile=" +
                                    encodeURIComponent(options.logFile))
                self.urlOpts.append("fileLevel=" +
                                    encodeURIComponent(options.fileLevel))
            if options.consoleLevel:
                self.urlOpts.append("consoleLevel=" +
                                    encodeURIComponent(options.consoleLevel))
            if options.totalChunks:
                self.urlOpts.append("totalChunks=%d" % options.totalChunks)
                self.urlOpts.append("thisChunk=%d" % options.thisChunk)
            if options.chunkByDir:
                self.urlOpts.append("chunkByDir=%d" % options.chunkByDir)
            if options.shuffle:
                self.urlOpts.append("shuffle=1")
Example #8
0
  def buildURLOptions(self, options):
    """ Add test control options from the command line to the url 

        URL parameters to test URL:

        autorun -- kick off tests automatically
        closeWhenDone -- runs quit.js after tests
        logFile -- logs test run to an absolute path
        totalChunks -- how many chunks to split tests into
        thisChunk -- which chunk to run
        timeout -- per-test timeout in seconds
    """
  
    # allow relative paths for logFile
    if options.logFile:
      options.logFile = self.getLogFilePath(options.logFile)
    if options.browserChrome:
      self.makeTestConfig(options)
    else:
      if options.autorun:
        self.urlOpts.append("autorun=1")
      if options.timeout:
        self.urlOpts.append("timeout=%d" % options.timeout)
      if options.closeWhenDone:
        self.urlOpts.append("closeWhenDone=1")
      if options.logFile:
        self.urlOpts.append("logFile=" + encodeURIComponent(options.logFile))
        self.urlOpts.append("fileLevel=" + encodeURIComponent(options.fileLevel))
      if options.consoleLevel:
        self.urlOpts.append("consoleLevel=" + encodeURIComponent(options.consoleLevel))
      if options.totalChunks:
        self.urlOpts.append("totalChunks=%d" % options.totalChunks)
        self.urlOpts.append("thisChunk=%d" % options.thisChunk)
      if options.chunkByDir:
        self.urlOpts.append("chunkByDir=%d" % options.chunkByDir)
      if options.shuffle:
        self.urlOpts.append("shuffle=1")