Skip to content

Commit 71c35f8

Browse files
fixed driver_class bugs
1 parent 7e313b6 commit 71c35f8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

py/conftest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,13 @@ def driver(request):
211211
global driver_instance
212212
driver_class = getattr(request, "param", "Chrome").capitalize()
213213
selenium_driver = Driver(driver_class, request)
214-
driver_instance = selenium_driver.driver
215214

216215
# skip tests if not available on the platform
217-
if driver_class == "Safari" and selenium_driver.exe_platform != "Darwin":
216+
if driver_class.lower() == "safari" and selenium_driver.exe_platform != "Darwin":
218217
pytest.skip("Safari tests can only run on an Apple OS")
219-
if driver_class == "Ie" and selenium_driver.exe_platform != "Windows":
218+
if driver_class.lower() == "ie" and selenium_driver.exe_platform != "Windows":
220219
pytest.skip("IE and EdgeHTML Tests can only run on Windows")
221-
if "WebKit" in driver_class and selenium_driver.exe_platform != "Linux":
220+
if "webkit" in driver_class.lower() and selenium_driver.exe_platform != "Linux":
222221
pytest.skip("Webkit tests can only run on Linux")
223222
# conditionally mark tests as expected to fail based on driver
224223
marker = request.node.get_closest_marker(f"xfail_{driver_class.lower()}")
@@ -235,6 +234,8 @@ def driver(request):
235234

236235
request.addfinalizer(selenium_driver.stop_driver)
237236

237+
driver_instance = selenium_driver.driver
238+
238239
yield driver_instance
239240

240241

0 commit comments

Comments
 (0)