|
27 | 27 | from test.selenium.webdriver.common.network import get_lan_ip |
28 | 28 | from test.selenium.webdriver.common.webserver import SimpleWebServer |
29 | 29 |
|
30 | | - |
31 | 30 | drivers = ( |
32 | 31 | "chrome", |
33 | 32 | "edge", |
@@ -420,43 +419,6 @@ def server(request): |
420 | 419 | server.start() |
421 | 420 | yield server |
422 | 421 | server.stop() |
423 | | - _socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
424 | | - url = f"http://{_host}:{_port}/status" |
425 | | - try: |
426 | | - _socket.connect((_host, _port)) |
427 | | - print( |
428 | | - "The remote driver server is already running or something else" |
429 | | - "is using port {}, continuing...".format(_port) |
430 | | - ) |
431 | | - except Exception: |
432 | | - remote_env = os.environ.copy() |
433 | | - if platform.system() == "Linux": |
434 | | - # There are issues with window size/position when running Firefox |
435 | | - # under Wayland, so we use XWayland instead. |
436 | | - remote_env["MOZ_ENABLE_WAYLAND"] = "0" |
437 | | - print("Starting the Selenium server") |
438 | | - process = subprocess.Popen( |
439 | | - [ |
440 | | - "java", |
441 | | - "-jar", |
442 | | - _path, |
443 | | - "standalone", |
444 | | - "--port", |
445 | | - "4444", |
446 | | - "--selenium-manager", |
447 | | - "true", |
448 | | - "--enable-managed-downloads", |
449 | | - "true", |
450 | | - ], |
451 | | - env=remote_env, |
452 | | - ) |
453 | | - print(f"Selenium server running as process: {process.pid}") |
454 | | - assert wait_for_server(url, 10), f"Timed out waiting for Selenium server at {url}" |
455 | | - print("Selenium server is ready") |
456 | | - yield process |
457 | | - process.terminate() |
458 | | - process.wait() |
459 | | - print("Selenium server has been terminated") |
460 | 422 |
|
461 | 423 |
|
462 | 424 | @pytest.fixture(autouse=True, scope="session") |
|
0 commit comments