diff --git a/tests/tests_webdriver/test_webdriver.py b/tests/tests_webdriver/test_webdriver.py index f35ae376f..4ea736839 100644 --- a/tests/tests_webdriver/test_webdriver.py +++ b/tests/tests_webdriver/test_webdriver.py @@ -1,4 +1,5 @@ import os +import pathlib import pytest from selenium.common.exceptions import WebDriverException @@ -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