How to use the behave.step function in behave

To help you get started, we’ve selected a few behave examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GNOME / gnome-logs / tests / steps / general.py View on Github external
@step(u'Go Back')
def go_back(context):
    context.app.child('This is a test').click()
github GNOME / gnome-logs / tests / steps / general.py View on Github external
@step(u'Click on search')
def click_on_search(context):
    context.app.child('Find').click()
github GNOME / gnome-boxes / tests / steps / general.py View on Github external
@step('Focus VM')
def focus_vm(context):
    drawing_area = None
    drawing_area = context.app.findChildren(lambda x: x.roleName == 'drawing area' and x.showing)
    if drawing_area:
        drawing_area[0].click()
github GNOME / gnome-boxes / tests / steps / utils.py View on Github external
@step('"{pattern}" is not visible with command "{command}"')
def check_pattern_not_visible(context, pattern, command):
    sleep(0.2) # time for all to get set
    out = check_output(command, shell=True)
    assert out.find(pattern) == -1, 'pattern %s is visible with %s' % (pattern, command)
github GNOME / gnome-boxes / tests / steps / creation.py View on Github external
@step('Create new box from menu "{sys_name}"')
def create_new_vm_from_menu(context, sys_name):
    context.app.child('New').click()
    get_showing_node_name(sys_name, context.app).click()
github ggozad / behaving / src / behaving / mobile / steps / devices.py View on Github external
@step(u'I add vcard "{path}" to my contact list')
def add_contact(context, path):
    vcard_path = os.path.join(context.attachment_dir, path)
    if context.browser.driver_name == 'ios':
        subprocess.call([
            'xcrun', 'simctl', 'addmedia',
            context.browser.udid(), vcard_path
        ])
    else:
        name = context.persona['id']
        emulator_id = get_android_emulator_id_from_name(name)
        check_output([
            'adb', "-s", emulator_id, 'push', vcard_path, '/sdcard/Download/'
        ])
        vcard_name = path.split('/')[1]
        check_output([
            'adb', "-s", emulator_id, 'shell', 'am', 'start', '-t',
github longaccess / longaccess-client / behave_cli / api / steps.py View on Github external
@step(u'the API authentication is wrong')
def api_auth_fail(context):
    context.mock_api.test('authFails', 'longaccessauth')
github ggozad / behaving / src / behaving / web / steps / forms.py View on Github external
@step(u'I select "{value}" from "{name}"')
@persona_vars
def i_select(context, value, name):
    try:
        context.browser.select(name, value)
    except ElementDoesNotExist:
        inp = context.browser.find_by_xpath("//input[@name='%s'][@value='%s']" % (name, value))
        assert inp, u'Element not found'
        inp.first.check()
github Containers-Testing-Framework / ctf-cli / features / steps / command_steps.py View on Github external
@step(u'I remove the environment variable "{env_name}"')
def step_I_remove_the_environment_variable(context, env_name):
    if not hasattr(context, "environ"):
        context.environ = {}
    context.environ[env_name] = ""
    os.environ[env_name] = ""
    del context.environ[env_name]
    del os.environ[env_name]
github ggozad / behaving / src / behaving / web / steps / forms.py View on Github external
@step('I set the inner HTML of the element with id "{id}" to "{contents}"')
@persona_vars
def set_html_content_to_element_with_id(context, id, contents):
    assert context.browser.evaluate_script("document.getElementById('%s').innerHTML = '%s'" % (id, contents)), \
        u'Element not found or could not set HTML content'