Beispiel #1
0
    def configure(self, options, config):
        if options.selenium_ss_dir:
            self.ss_dir = os.path.abspath(options.selenium_ss_dir)
        else:
            self.ss_dir = os.path.abspath('failure_screenshots')
        valid_browsers = ['firefox', 'internet_explorer', 'chrome']
        if options.driver_type not in valid_browsers:
            raise RuntimeError('--driver-type must be one of: %s' %
                               ' '.join(valid_browsers))
        self._driver_type = options.driver_type.replace('_', ' ')
        self._remote_server_address = options.remote_server_address
        self._selenium_port = options.selenium_port
        self._driver = None
        self._current_windows_handle = None

        self.x_display = 1
        self.run_headless = False
        if options.headless:
            self.run_headless = True
            self.x_display = int(options.headless)
        if options.track_stats and options.track_stats not in ('trips',
                                                               'runtime'):
            raise RuntimeError('--track-stats must be "trips" or "runtime"')
        self._track_stats = options.track_stats
        Plugin.configure(self, options, config)
Beispiel #2
0
 def options(self, parser, env=None):
     if env is None:
         env = os.environ
     parser.add_option('--selenium-ss-dir',
                       help='Directory for failure screen shots.')
     parser.add_option(
         '--headless',
         help=
         "Run the Selenium tests in a headless mode, with virtual frames starting with the given index (eg. 1)",
         default=None)
     parser.add_option('--driver-type',
                       help='The type of driver that needs to be created',
                       default='firefox')
     parser.add_option(
         '--remote-server-address',
         help=
         'Use a remote server to run the tests, must pass in the server address',
         default='localhost')
     parser.add_option('--selenium-port',
                       help='The port for the selenium server',
                       default='4444')
     parser.add_option(
         '--track-stats',
         help=
         'After the suite is run print a table of test name/runtime/number of trips to the server.  defaults to ordering by trips to the server',
         default=None)
     Plugin.options(self, parser, env)
 def options(self, parser, env=None):
     if env is None:
         env = os.environ
     parser.add_option('--old-selenium-ss-dir',
                       dest='selenium_ss_dir',
                       help='Directory for failure screen shots.',
                       )
     parser.add_option('--old-headless',
                       dest='headless',
                       help="Run the Selenium tests in a headless mode, with virtual frames starting with the given index (eg. 1)",
                       default=None)
     parser.add_option('--old-driver-type',
                       dest='driver_type',
                       help='The type of driver that needs to be created',
                       default='firefox')
     parser.add_option('--old-remote-server-address',
                       dest='remote_server_address',
                       help='Use a remote server to run the tests, must pass in the server address',
                       default='localhost')
     parser.add_option('--old-selenium-port',
                       dest='selenium_port',
                       help='The port for the selenium server',
                       default='4444')
     parser.add_option('--old-track-stats',
                       dest='track_stats',
                       help='After the suite is run print a table of test name/runtime/number of trips to the server.  defaults to ordering by trips to the server',
                       default=None)
     Plugin.options(self, parser, env)
    def configure(self, options, config):
        if options.selenium_ss_dir:
            self.ss_dir = os.path.abspath(options.selenium_ss_dir)
        else:
            self.ss_dir = os.path.abspath('failure_screenshots')
        valid_browsers = ['firefox', 'internet_explorer', 'chrome']
        if options.driver_type not in valid_browsers:
            raise RuntimeError(
                '--driver-type must be one of: %s' % ' '.join(valid_browsers)
            )
        self._firefox_binary = options.firefox_binary
        self._driver_type = options.driver_type.replace('_', ' ')
        self._remote_server_address = options.remote_server_address
        self._selenium_port = options.selenium_port
        self._driver = None
        self._current_windows_handle = None

        self.x_display = 1
        self.run_headless = False
        if options.headless:
            self.run_headless = True
            self.x_display = int(options.headless)
        if options.track_stats and options.track_stats not in ('trips', 'runtime'):  # noqa
            raise RuntimeError('--track-stats must be "trips" or "runtime"')
        self._track_stats = options.track_stats
        Plugin.configure(self, options, config)
 def options(self, parser, env=None):
     if env is None:
         env = os.environ
     parser.add_option(
         '--selenium-ss-dir',
         help='Directory for failure screen shots.'
     )
     parser.add_option(
         '--headless',
         help=(
             "Run the Selenium tests in a headless mode, with virtual "
             "frames starting with the given index (eg. 1)"
         ),
         default=None,
     )
     parser.add_option(
         '--driver-type',
         help='The type of driver that needs to be created',
         default='firefox',
     )
     parser.add_option(
         '--firefox-binary',
         help='the path to the firefox browser binary',
         default=None,
     )
     parser.add_option(
         '--remote-server-address',
         help='Use a remote server to run the tests, must pass in the server address',  # noqa
         default='localhost',
     )
     parser.add_option(
         '--selenium-port',
         help='The port for the selenium server',
         default='4444',
     )
     parser.add_option(
         '--track-stats',
         help=(
             'After the suite is run print a table of test '
             'name/runtime/number of trips to the server.  defaults to '
             'ordering by trips to the server'
         ),
         default=None,
     )
     parser.add_option(
         '--ff-profile',
         help=(
             'Specify overrides for the FireFox profile'
         ),
         default=None,
         action='append'
     )
     Plugin.options(self, parser, env)
Beispiel #6
0
 def configure(self, options, config):
     # This is only checked since this plugin is configured regardless if
     # the sshtunnel flag is used, and we only want this info here if the
     # --remote-server flag is used
     if options.remote_server:
         try:
             to_port, from_port = options.to_from_ports.split(':', 1)
         except:
             raise RuntimeError("--to_from_ports should be of the form x:y")
         else:
             self._to_port = to_port
             self._from_port = from_port
         self._remote_server = options.remote_server
         self._username = options.username
     Plugin.configure(self, options, config)
 def configure(self, options, config):
     # This is only checked since this plugin is configured regardless if
     # the sshtunnel flag is used, and we only want this info here if the
     # --remote-server flag is used
     if options.remote_server:
         try:
             to_port, from_port = options.to_from_ports.split(':', 1)
         except:
             raise RuntimeError("--to_from_ports should be of the form x:y")
         else:
             self._to_port = to_port
             self._from_port = from_port
         self._remote_server = options.remote_server
         self._username = options.username
     Plugin.configure(self, options, config)
 def options(self, parser, env=None):
     if env is None:
         env = os.environ
     parser.add_option('--remote-server',
                       help='Use a remote server to run the tests, must pass in the server address',
                       )
     parser.add_option('--to-from-ports',
                       help='Should be of the form x:y where x is the port that needs to be forwarded to the server and y is the port that the server needs forwarded back to the localhost',
                       default='4444:8001',
                       )
     parser.add_option('--username',
                       help='The username with which to create the ssh tunnel to the remote server',
                       default=None,
                       )
     Plugin.options(self, parser, env)
Beispiel #9
0
 def options(self, parser, env=None):
     if env is None:
         env = os.environ
     parser.add_option(
         '--remote-server',
         help=
         'Use a remote server to run the tests, must pass in the server address',
     )
     parser.add_option(
         '--to-from-ports',
         help=
         'Should be of the form x:y where x is the port that needs to be forwarded to the server and y is the port that the server needs forwarded back to the localhost',
         default='4444:8001',
     )
     parser.add_option(
         '--username',
         help=
         'The username with which to create the ssh tunnel to the remote server',
         default=None,
     )
     Plugin.options(self, parser, env)
 def configure(self, options, config):
     Plugin.configure(self, options, config)
 def options(self, parser, env=os.environ):
     Plugin.options(self, parser, env)
 def __init__(self):
     Plugin.__init__(self)
     self.server_started = False
     self.server_thread = None