Ejemplo n.º 1
0
def fill_in_textfield(step, field_name, value):
    with AssertContextManager(step):
        date_field = find_any_field(world.browser, DATE_FIELDS, field_name)
        if date_field:
            field = date_field
        else:
            field = find_any_field(world.browser, TEXT_FIELDS, field_name)

        assert_true(step, field, 'Can not find a field named "%s"' % field_name)
        if date_field:
            field.send_keys(Keys.DELETE)
        else:
            field.clear()
        field.send_keys(value)
Ejemplo n.º 2
0
def fill_in_textfield(step, field_name, value):
    with AssertContextManager(step):
        date_field = find_any_field(world.browser, DATE_FIELDS, field_name)
        if date_field:
            field = date_field
        else:
            field = find_any_field(world.browser, TEXT_FIELDS, field_name)

        assert_true(step, field,
                    'Can not find a field named "%s"' % field_name)
        if date_field:
            field.send_keys(Keys.DELETE)
        else:
            field.clear()
        field.send_keys(value)
Ejemplo n.º 3
0
def input_has_value(step, field_name, value):
    """
    Check that the form input element has given value.
    """
    with AssertContextManager(step):
        text_field = find_any_field(world.browser, DATE_FIELDS + TEXT_FIELDS, field_name)
        assert_false(step, text_field is False, 'Can not find a field named "%s"' % field_name)
        assert_equals(text_field.get_attribute("value"), value)
Ejemplo n.º 4
0
def input_has_value(step, field_name, value):
    """
    Check that the form input element has given value.
    """
    with AssertContextManager(step):
        text_field = find_any_field(world.browser, DATE_FIELDS + TEXT_FIELDS,
                                    field_name)
        assert_false(step, text_field is False,
                     'Can not find a field named "%s"' % field_name)
        assert_equals(text_field.get_attribute('value'), value)