def test_attach_file(request, browser, app_url):
    """Should provide a way to change file field value"""
    file_path = pathlib.Path(
        os.getcwd(),  # NOQA PTH109
        "tests",
        "mockfile.txt",
    )

    browser.visit(app_url)
    browser.attach_file("file", str(file_path))
    browser.find_by_name("upload").click()

    html = browser.html
    assert "text/plain" in html

    with open(file_path) as f:
        assert str(f.read()) in html
Should provide a way to change file field value
tests/tests_webdriver/test_webdriver.py