Ejemplo n.º 1
0
def main():
    cmd_opts, args = get_opts_remote()

    clear_old_results()

    print '----------------------------------------------------------------------'

    sst.runtests(
        args,
        test_dir=cmd_opts.dir_name,
        report_format=cmd_opts.report_format,
        browser_type=cmd_opts.browser_type,
        browser_version=cmd_opts.browser_version,
        browser_platform=cmd_opts.browser_platform,
        session_name=cmd_opts.session_name,
        webdriver_remote_url=cmd_opts.webdriver_remote_url,
        javascript_disabled=cmd_opts.javascript_disabled,
        shared_directory=cmd_opts.shared_modules,
        screenshots_on=cmd_opts.screenshots_on,
        failfast=cmd_opts.failfast,
        debug=cmd_opts.debug,
        extended=cmd_opts.extended_tracebacks,
    )

    print '----------------------------------------------------------------------'
Ejemplo n.º 2
0
def main():
    cmd_opts, args = get_opts_run()

    print '----------------------------------------------------------------------'
    print 'starting SST...'

    if cmd_opts.browsermob and cmd_opts.run_tests:
        print 'Warning: can not record local traffic from django testproject'

    if cmd_opts.browsermob:
        browsermob_process = run_browsermob_server(cmd_opts.browsermob)

    if cmd_opts.run_tests:
        cmd_opts.dir_name = 'selftests'
        run_django()

    if cmd_opts.xserver_headless:
        from sst.xvfbdisplay import Xvfb
        print '\nstarting virtual display...'
        display = Xvfb(width=1024, height=768)
        display.start()

    if not cmd_opts.quiet:
        print ''
        print '  date time: %s' % datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
        print '  test directory: %r' % cmd_opts.dir_name
        print '  report format: %r' % cmd_opts.report_format
        print '  browser type: %r' % cmd_opts.browser_type
        print '  javascript disabled: %r' % cmd_opts.javascript_disabled
        print '  browswermob proxy launcher: %r' % cmd_opts.browsermob
        print '  shared directory: %r' % cmd_opts.shared_modules
        print '  screenshots on error: %r' % cmd_opts.screenshots_on
        print '  failfast: %r' % cmd_opts.failfast
        print '  debug: %r' % cmd_opts.debug
        print '  headless xserver: %r' % cmd_opts.xserver_headless
        print ''

    clear_old_results()
    sst.runtests(
        args,
        test_dir=cmd_opts.dir_name,
        report_format=cmd_opts.report_format,
        browser_type=cmd_opts.browser_type,
        javascript_disabled=cmd_opts.javascript_disabled,
        browsermob_enabled=bool(cmd_opts.browsermob),
        shared_directory=cmd_opts.shared_modules,
        screenshots_on=cmd_opts.screenshots_on,
        failfast=cmd_opts.failfast,
        debug=cmd_opts.debug,
        extended=cmd_opts.extended_tracebacks,
    )

    print '----------------------------------------------------------------------'

    if cmd_opts.browsermob:
        print '\nkilling browsermob proxy...'
        browsermob_process.kill()
        browsermob_process.wait()

    if cmd_opts.xserver_headless:
        print '\nstopping virtual display...'
        display.stop()

    if cmd_opts.run_tests:
        print '\nkilling django...'
        kill_django()