Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfehler committed Jun 14, 2024
1 parent ab7858e commit ffb2c86
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/tests_webdriver/test_webdriver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import pathlib

import pytest
from selenium.common.exceptions import WebDriverException
Expand All @@ -22,14 +23,19 @@ def test_webdriver_local_driver_not_present(browser_name):
Browser(browser_name, service=service)


@pytest.mark.doit
def test_attach_file(request, browser):
"""Should provide a way to change file field value"""
request.addfinalizer(browser.quit)

file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "mockfile.txt")
file_path = pathlib.Path(
os.getcwd(), # NOQA PTH109
"tests",
"mockfile.txt",
)

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

html = browser.html
Expand Down

0 comments on commit ffb2c86

Please sign in to comment.