Exemple #1
0
def main(args=sys.argv[1:]):
    parser = argparse.ArgumentParser(prog="Salad", description='BDD browswer-automation made tasty.')

    parser.add_argument('--browser', default=DEFAULT_BROWSER,
                        metavar='BROWSER', choices=BROWSER_CHOICES,
                        help=('Browser to use. Options: %s Default is %s.' %
                              (BROWSER_CHOICES, DEFAULT_BROWSER)))
    parser.add_argument('--remote-url',
                        help='Selenium server url for remote browsers')
    parser.add_argument('args', nargs=argparse.REMAINDER)

    parsed_args = parser.parse_args()
    world.drivers = [parsed_args.browser]
    world.remote_url = parsed_args.remote_url
    lettuce_main(args=parsed_args.args)
Exemple #2
0
def main(args=sys.argv[1:]):
    parser = argparse.ArgumentParser(prog="Salad",
                                     description=("BDD browswer-automation "
                                                  "made tasty."))

    parser.add_argument('--browser',
                        default=DEFAULT_BROWSER,
                        action=store_driver_and_version,
                        metavar='BROWSER',
                        help=('Browser to use. Options: %s Default is %s.' %
                              (BROWSER_CHOICES, DEFAULT_BROWSER)))

    parser.add_argument('--remote-url',
                        help='Selenium server url for remote browsers')

    parser.add_argument('--name',
                        help=('Give your job a name so it '
                              'can be identified on saucelabs'))

    parser.add_argument('--timeout',
                        help=("Set the saucelabs' idle-timeout for the job"))

    (parsed_args, leftovers) = parser.parse_known_args()
    world.drivers = [parsed_args.browser]
    world.remote_url = parsed_args.remote_url
    world.remote_capabilities = {}

    if 'version' in parsed_args:
        world.remote_capabilities['version'] = parsed_args.version

    if 'platform' in parsed_args:
        world.remote_capabilities['platform'] = parsed_args.platform

    name = _get_current_timestamp() + " -  "
    if not parsed_args.name:
        name += "unnamed job"
    else:
        name += parsed_args.name
    world.remote_capabilities['name'] = name

    if not parsed_args.timeout:
        world.remote_capabilities['idle-timeout'] = 120
    else:
        world.remote_capabilities['idle-timeout'] = parsed_args.timeout

    lettuce_main(args=leftovers)
Exemple #3
0
def main(args=sys.argv[1:]):
    parser = argparse.ArgumentParser(
        prog="Salad", description='BDD browswer-automation made tasty.')

    parser.add_argument('--browser',
                        default=DEFAULT_BROWSER,
                        metavar='BROWSER',
                        choices=BROWSER_CHOICES,
                        help=('Browser to use. Options: %s Default is %s.' %
                              (BROWSER_CHOICES, DEFAULT_BROWSER)))
    parser.add_argument('--remote-url',
                        help='Selenium server url for remote browsers')
    parser.add_argument('args', nargs=argparse.REMAINDER)

    parsed_args = parser.parse_args()
    world.drivers = [parsed_args.browser]
    world.remote_url = parsed_args.remote_url
    lettuce_main(args=parsed_args.args)
Exemple #4
0
def main(args=sys.argv[1:]):
    parser = argparse.ArgumentParser(prog="Salad",
                                     description=("BDD browswer-automation "
                                                  "made tasty."))

    parser.add_argument('--browser', default=DEFAULT_BROWSER,
                        action=store_driver_and_version, metavar='BROWSER',
                        help=('Browser to use. Options: %s Default is %s.' %
                              (BROWSER_CHOICES, DEFAULT_BROWSER)))

    parser.add_argument('--remote-url',
                        help='Selenium server url for remote browsers')

    parser.add_argument('--name',
                        help=('Give your job a name so it '
                              'can be identified on saucelabs'))

    parser.add_argument('--timeout',
                        help=("Set the saucelabs' idle-timeout for the job"))

    (parsed_args, leftovers) = parser.parse_known_args()
    world.drivers = [parsed_args.browser]
    world.remote_url = parsed_args.remote_url
    world.remote_capabilities = {}

    if 'version' in parsed_args:
        world.remote_capabilities['version'] = parsed_args.version

    if 'platform' in parsed_args:
        world.remote_capabilities['platform'] = parsed_args.platform

    name = _get_current_timestamp() + " -  "
    if not parsed_args.name:
        name += "unnamed job"
    else:
        name += parsed_args.name
    world.remote_capabilities['name'] = name

    if not parsed_args.timeout:
        world.remote_capabilities['idle-timeout'] = 120
    else:
        world.remote_capabilities['idle-timeout'] = parsed_args.timeout

    lettuce_main(args=leftovers)
Exemple #5
0
def main(args=sys.argv[1:]):
    # Right now, this doesn't do anything but alias.  More useful is coming though!
    lettuce_main(args=sys.argv[1:])
Exemple #6
0
def main(args=sys.argv[1:]):
    parser = argparse.ArgumentParser(prog="Salad",
                                     description=("BDD browswer-automation "
                                                  "made tasty."))

    parser.add_argument('-V', action='store_true', default=False,
                        help="show program's version number and exit")

    parser.add_argument('--browser', default=DEFAULT_BROWSER,
                        action=store_driver_and_version, metavar='BROWSER',
                        help=('Browser to use. Options: %s Default is %s.' %
                              (BROWSER_CHOICES, DEFAULT_BROWSER)))

    parser.add_argument('--remote-url',
                        help='Selenium server url for remote browsers')

    parser.add_argument('--name',
                        help=('Give your job a name so it '
                              'can be identified on saucelabs'))

    parser.add_argument('--timeout',
                        help=("Set the saucelabs' idle-timeout for the job"))

    parser.add_argument('--scenarios', '-s',
                        help=("Limit to the specified scenarios"))

    (parsed_args, leftovers) = parser.parse_known_args()
    world.drivers = [parsed_args.browser]
    world.remote_url = parsed_args.remote_url
    world.remote_capabilities = {}

    if 'version' in parsed_args:
        world.remote_capabilities['version'] = parsed_args.version

    if 'platform' in parsed_args:
        world.remote_capabilities['platform'] = parsed_args.platform

    name = _get_current_timestamp() + " -  "
    if not parsed_args.name:
        name += "unnamed job"
    else:
        name += parsed_args.name
    world.remote_capabilities['name'] = name

    if not parsed_args.timeout:
        world.remote_capabilities['idle-timeout'] = 120
    else:
        world.remote_capabilities['idle-timeout'] = parsed_args.timeout

    world.remote_capabilities['trustAllSSLCertificates'] = True
    world.remote_capabilities['acceptSslCerts'] = True

    if parsed_args.scenarios:
        scenarios = set()
        for part in parsed_args.scenarios.split(','):
            x = part.split('-')
            scenarios.update(range(int(x[0]), int(x[-1])+1))
        scenarios = [str(x) for x in sorted(scenarios)]
        leftovers.append('-s %s' % (','.join(scenarios)))
        del parsed_args.scenarios

    lettuce_main(args=leftovers)
Exemple #7
0
def main(args=sys.argv[1:]):
    # Right now, this doesn't do anything but alias.  More useful is coming though!
    lettuce_main(args=sys.argv[1:])