[py] Use a capability to switch engines for Edge (#8096)

* Use ms:edgeChromium capability in python bindings.

* Update edge_options_tests.

* Fix chromium command prefixes.

* Import warnings for edge webdriver.py.

Co-authored-by: David Burns <david.burns@theautomatedtester.co.uk>
Cr-Mirrored-From: https://chromium.googlesource.com/external/github.com/SeleniumHQ/selenium
Cr-Mirrored-Commit: 617f16f3a0142cba3740705ebc67ca7055a47498
diff --git a/conftest.py b/conftest.py
index 5090310..1c11ddb 100644
--- a/conftest.py
+++ b/conftest.py
@@ -120,7 +120,6 @@
             options = get_options(driver_class, request.config)
         if driver_class == 'ChromiumEdge':
             options = get_options(driver_class, request.config)
-            kwargs.update({'is_legacy': False})
         if driver_path is not None:
             kwargs['executable_path'] = driver_path
         if options is not None:
@@ -136,10 +135,12 @@
     browser_args = config.option.args
     options = None
 
+    if driver_class == 'ChromiumEdge':
+        options = getattr(webdriver, 'EdgeOptions')()
+        options.use_chromium = True
+
     if browser_path or browser_args:
-        if driver_class == 'ChromiumEdge':
-            options = getattr(webdriver, 'EdgeOptions')(False)
-        else:
+        if not options:
             options = getattr(webdriver, '{}Options'.format(driver_class))()
         if driver_class == 'WebKitGTK':
             options.overlay_scrollbars_enabled = False