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