Example #1
0
def before_all(context):
    # import mypackage
    # context.attachment_dir = os.path.join(os.path.dirname(mypackage.__file__), 'tests/data')
    # context.sms_path = os.path.join(os.path.dirname(mypackage.__file__), '../../var/sms/')
    # context.gcm_path = os.path.join(os.path.dirname(mypackage.__file__), '../../var/gcm/')
    # context.mail_path = os.path.join(os.path.dirname(mypackage.__file__), '../../var/mail/')
    benv.before_all(context)
def before_all(context):
    mail_dir = '/tmp/mailmock'
    context.mail_path = '/tmp/mailmock'
    if not os.path.exists(mail_dir):
        os.makedirs(mail_dir)

    config.update(context.config.userdata)

    if config['remote']:
        context.remote_webdriver = True
        s_username = os.environ['SAUCELABS_USER']
        s_apikey = os.environ['SAUCELABS_KEY']
        saucelabs_url = 'http://%s:%[email protected]:80/wd/hub' % (s_username, s_apikey)
        context.browser_args = {'url': saucelabs_url}
    else:
        context.default_browser = 'chrome'
        context.single_browser = True
        if config['headless']:
            chrome_options = webdriver.ChromeOptions()
            chrome_options.add_argument("--headless")
            context.browser_args = {'options': chrome_options}

    context.base_url = config['base_url']

    context.URNs = URNs

    context.URNREGIONs = URNREGIONs

    benv.before_all(context)
Example #3
0
def before_all(context):
    import behaving
    context.attachment_dir = os.path.join(os.path.dirname(behaving.__file__), 'tests/data')
    context.sms_path = os.path.join(os.path.dirname(behaving.__file__), '../../var/sms/')
    context.mail_path = os.path.join(os.path.dirname(behaving.__file__), '../../var/mail/')
    context.screenshots_dir = os.path.join(os.path.dirname(behaving.__file__), '../../var/screenshots/')
    benv.before_all(context)
Example #4
0
def before_all(context):
    config.update(context.config.userdata)

    context.default_browser = 'chrome'
    context.single_browser = True

    context.base_url = config['base_url']
    benv.before_all(context)
Example #5
0
def before_all(context):
    benv.before_all(context)

    try:
        copyfile("db.yaml", "db.yaml.test_backup")
        os.remove("db.yaml")
    except:
        pass
Example #6
0
def before_all(context):
    import behaving
    context.attachment_dir = os.path.join(os.path.dirname(behaving.__file__), 'tests/data')
    context.sms_path = os.path.join(os.path.dirname(behaving.__file__), '../../var/sms/')
    context.mail_path = os.path.join(os.path.dirname(behaving.__file__), '../../var/mail/')
    context.gcm_path = os.path.join(os.path.dirname(behaving.__file__), '../../var/gcm/')
    context.screenshots_dir = os.path.join(os.path.dirname(behaving.__file__), '../../var/screenshots/')
    benv.before_all(context)
Example #7
0
def before_all(context):
    context.attachment_dir = os.path.join(os.path.dirname(app.__file__), 'tests/data')
    context.sms_path = os.path.join(os.path.dirname(app.__file__), '../../var/sms/')
    context.mail_path = os.path.join(os.path.dirname(app.__file__), '../../var/mail/')
    context.screenshots_dir = os.path.join(os.path.dirname(app.__file__), '../../var/screenshot/')
    context.base_url = "http://localhost:8000/"
    context.default_browser = "phantomjs"
    context.browser_args = {
        "service_args": ['--ignore-ssl-errors=true', '--ssl-protocol=any'],
    }
    benv.before_all(context)
Example #8
0
def before_all(context):
    context.default_browser = os.getenv("BEHAVE_DEFAULT_BROWSER", 'chrome')

    context.default_browser_size = (1280, 1024)
    port = "2992" if app.config.get("DEBUG", False) else "5000"
    default_url = "http://localhost:{}".format(port)
    context.base_url = os.getenv("BEHAVE_BASE_URL", default_url)

    benv.before_all(context)

    mixer.init_app(app)
Example #9
0
def before_all(context):
    context.default_browser = os.getenv("BEHAVE_DEFAULT_BROWSER", 'chrome')

    context.default_browser_size = (1280, 1024)
    port = "2992" if app.config.get("DEBUG", False) else "5000"
    default_url = "http://localhost:{}".format(port)
    context.base_url = os.getenv("BEHAVE_BASE_URL", default_url)

    benv.before_all(context)

    mixer.init_app(app)
Example #10
0
def before_all(context):

    #basedir = os.path.join(os.path.dirname(__file__), 'tests')
    #desired_capabilities = webdriver.DesiredCapabilities.FIREFOX
    #context.browser = webdriver.Remote(
    #    desired_capabilities=desired_capabilities,
    #    command_executor="http://hub.testingbot.com:4444/wd/hub"
    #)
    #screenshots_dir = os.path.join(basedir, 'screenshots')
    context.browser = default_browser
    #context.screenshots_dir = screenshots_dir
    benv.before_all(context)
Example #11
0
def before_all(context):
    benv.before_all(context)
    context.browser = choose_driver()
    if LOCAL:
        context.mist_url = "http://localhost:8000"
    else:
        docker_info = docker_all_in_one(flavor="io")
        context.remote_info = docker_info
        context.mist_url = docker_info['URL']

    context.credentials = CREDENTIALS
    context.machine_name = "TESTMACHINE" + str(random.randint(1, 10000))
    context.key_name = "TESTKEY" + str(random.randint(1, 10000))
Example #12
0
def before_all(context):
    benv.before_all(context)
    context.browser = choose_driver()

    context.mist_config = dict()
    context.mist_config['MACHINE_NAME'] = "TESTMACHINE" + str(random.randint(1, 10000))
    context.mist_config['KEY_NAME'] = "TESTKEY" + str(random.randint(1, 10000))
    context.mist_config['CREDENTIALS'] = CREDENTIALS

    if not LOCAL:
        docker_info = docker_all_in_one(flavor="io")
        context.remote_info = docker_info

    context.mist_config['MIST_URL'] = MIST_URL if LOCAL else docker_info['URL']
Example #13
0
def before_all(context):
    benv.before_all(context)
    context.screenshots_dir = os.environ.get('SANITYSCREENSHOTDIR')
    context.default_browser = os.environ.get('SANITYBROWSER', '')
    if context.default_browser.lower() == 'chrome_headless':
        context.default_browser = 'chrome'
        options = Options()
        options.binary_location = '/usr/bin/google-chrome'
        options.add_argument('--headless')
        options.add_argument('--disable-gpu')
        context.browser_args = {
            'options': options,
        }
    context.base_url = get_base_url(os.environ['SANITYURL'])
Example #14
0
def before_all(context):
    # The path where screenshots will be saved.
    context.screenshots_dir = os.path.join(ROOT_PATH, 'test/screenshots')
    # The path where file attachments can be found.
    context.attachment_dir = os.path.join(ROOT_PATH, 'test/fixtures')
    # The path where emails can be found.
    context.mail_path = os.path.join(ROOT_PATH, 'test/emails')

    # Set base url for all relative links.
    context.base_url = BASE_URL

    # Always use remote web driver.
    context.remote_webdriver = 1
    context.default_browser = 'chrome'
    context.browser_args = {'command_executor': REMOTE_CHROME_URL}

    # Set the rest of the settings to default Behaving's settings.
    benv.before_all(context)
Example #15
0
def before_all(context):
    import behaving

    context.remote_webdriver_url = "http://selenium-hub:4444"
    context.default_browser = "firefox"
    context.accept_ssl_certs = True

    context.attachment_dir = os.path.join(os.path.dirname(behaving.__file__),
                                          "../../tests/data")
    context.sms_path = os.path.join(os.path.dirname(behaving.__file__),
                                    "../../var/sms/")
    context.mail_path = os.path.join(os.path.dirname(behaving.__file__),
                                     "../../var/mail/")
    context.gcm_path = os.path.join(os.path.dirname(behaving.__file__),
                                    "../../var/gcm/")
    context.screenshots_dir = os.path.join(os.path.dirname(behaving.__file__),
                                           "../../var/screenshots/")
    benv.before_all(context)
Example #16
0
def before_all(context):
    config.update(context.config.userdata)

    if config['remote']:
        context.remote_webdriver = True
        s_username = os.environ['SAUCELABS_USER']
        s_apikey = os.environ['SAUCELABS_KEY']
        saucelabs_url = 'http://%s:%[email protected]:80/wd/hub' % (s_username, s_apikey)
        context.browser_args = {'url': saucelabs_url}
    else:
        context.default_browser = 'chrome'
        context.single_browser = True
        if config['headless']:
            chrome_options = webdriver.ChromeOptions()
            chrome_options.add_argument("--headless")
            context.browser_args = {'options': chrome_options}

    context.base_url = config['base_url']
    benv.before_all(context)
def before_all(context):
    # import falcon_test
    # context.attachment_dir = os.path.join(os.path.dirname(falcon_test.__file__), 'tests/data')
    # context.sms_path = os.path.join(os.path.dirname(falcon_test.__file__), '../../var/sms/')
    # context.mail_path = os.path.join(os.path.dirname(falcon_test.__file__), '../../var/mail/')
    # clear database
    graph_db = Graph(settings.DATABASE_URL)
    # graph_db.delete_all()
    new_user_node = graph_db.find_one('USER',
                                      property_key='email',
                                      property_value='*****@*****.**')
    graph_db.delete(new_user_node)
    interest_node = graph_db.find_one('INTEREST', property_key='name',
                                      property_value=PERSONAS['interest']['name'])
    interest_relationships = graph_db.match(start_node=None,
                                            rel_type='INTERESTED_IN',
                                            end_node=interest_node)
    for relationship in interest_relationships:
        graph_db.delete(relationship)
    graph_db.delete(interest_node)
    context.base_url = "http://localhost:8000"
    benv.before_all(context)
Example #18
0
def before_all(context):
    benv.before_all(context)
Example #19
0
def before_all(context):
    setup_debug_on_error(context.config.userdata)
    benv.before_all(context)
    context.default_browser = os.environ.get('SANITYBROWSER', '')
    context.base_url = get_base_url(os.environ['SANITYURL'])
Example #20
0
def before_all(context):
    behaving_env.before_all(context)
def before_all(context):
    benv.before_all(context)
    context.base_url = "http://localdev.lightnetb.org/"
    context.screenshot_dir = os.path.join(os.path.dirname(__file__), "screenshots")
Example #22
0
def before_all(context):
    behaving_env.before_all(context)
    context.data_sender = DataSender()
    context.data_sender.start()
Example #23
0
def before_all(context):
    benv.before_all(context)