def test_input_text_in_simple_text(browser, config_host):
    very_parametrized_script_page = VeryParametrizedScript(
        browser, config_host)

    random_srting = ''.join(
        random.choices(string.ascii_letters + string.digits,
                       k=random.randint(0, 254)))
    very_parametrized_script_page.parameter_simple_text.send_keys(
        random_srting)

    expect(
        very_parametrized_script_page.parameter_simple_text.get_attribute(
            'value') == str(random_srting), "Field text is not equal to input")
    expect(
        get_underline_error_text(
            very_parametrized_script_page.parameter_simple_text) == "",
        "Underline text error is not empty: " + str(
            get_underline_error_text(
                very_parametrized_script_page.parameter_simple_text)))

    very_parametrized_script_page.parameter_simple_text.send_keys(Keys.ENTER)
    expect(
        very_parametrized_script_page.parameter_simple_text.get_attribute(
            "class") == "validate valid", "Class is not valid")

    assert_expectations()
def test_input_string_in_simple_int(browser, config_host):
    very_parametrized_script_page = VeryParametrizedScript(
        browser, config_host)

    very_parametrized_script_page.parameter_simple_int.send_keys(
        "String value" + Keys.ENTER)
    assert get_underline_error_text(very_parametrized_script_page.
                                    parameter_simple_int) == "integer expected"
def test_input_int_in_simple_int(browser, config_host):
    very_parametrized_script_page = VeryParametrizedScript(
        browser, config_host)

    random_int = random.randint(0, sys.maxsize)

    very_parametrized_script_page.parameter_simple_int.clear()
    very_parametrized_script_page.parameter_simple_int.send_keys(
        str(random_int) + Keys.ENTER)
    expect(
        very_parametrized_script_page.parameter_simple_int.get_attribute(
            "class") == "validate valid", "Class is not valid")
    expect(
        very_parametrized_script_page.parameter_simple_int.get_attribute(
            'value') == str(random_int), "Field text is not equal to input")
    expect(
        get_underline_error_text(
            very_parametrized_script_page.parameter_simple_int) == "",
        "Underline text error is not empty: " + str(
            get_underline_error_text(
                very_parametrized_script_page.parameter_simple_int)))

    assert_expectations()