Ejemplo n.º 1
0
def using_alternative_browser(step, browser_name):
    driver = browser_name.lower().replace(' ', '')
    if driver == 'zope':
        driver = 'zope.testbrowser'
    world.browsers.append(setup_browser(driver))
    world.browser = world.browsers[-1]
Ejemplo n.º 2
0
def using_alternative_browser(step, browser_name):
    driver = browser_name.lower().replace(' ', '')
    world.browsers.append(setup_browser(driver))
    world.browser = world.browsers[-1]
Ejemplo n.º 3
0
__FILENAME__ = browser
from lettuce import before, world, after
from splinter.browser import Browser
from salad.logger import logger


@before.all
def setup_master_browser():
    try:
        browser = world.drivers[0]
        remote_url = world.remote_url
    except AttributeError, IndexError:
        browser = 'firefox'
        remote_url = None

    world.master_browser = setup_browser(browser, remote_url)
    world.browser = world.master_browser


def setup_browser(browser, url=None):
    logger.info("Setting up browser %s..." % browser)
    try:
        if url:
            browser = Browser('remote', url=url,
                    browser=browser)
        else:
            browser = Browser(browser)
    except Exception as e:
        logger.warn("Error starting up %s: %s" % (browser, e))
        raise
    return browser
Ejemplo n.º 4
0
def using_alternative_browser(step, browser_name):
    """ switch the browser to the one specified in 'browser_name'
    """
    driver = browser_name.lower().replace(' ', '')
    world.browsers.append(setup_browser(driver))
    world.browser = world.browsers[-1]