diff --git a/py/conftest.py b/py/conftest.py index 562325b561a91..3c433f9baae11 100644 --- a/py/conftest.py +++ b/py/conftest.py @@ -36,7 +36,6 @@ "remote", "safari", "webkitgtk", - "chromiumedge", "wpewebkit", ) @@ -169,16 +168,13 @@ def get_options(driver_class, config): headless = bool(config.option.headless) options = None - if driver_class == "ChromiumEdge": - options = getattr(webdriver, "EdgeOptions")() - if browser_path or browser_args: if not options: options = getattr(webdriver, f"{driver_class}Options")() if driver_class == "WebKitGTK": options.overlay_scrollbars_enabled = False if browser_path is not None: - options.binary_location = browser_path + options.binary_location = browser_path.strip("'") if browser_args is not None: for arg in browser_args.split(): options.add_argument(arg) diff --git a/py/private/browsers.bzl b/py/private/browsers.bzl index 3561ef97474eb..28e8aa7b5f7ad 100644 --- a/py/private/browsers.bzl +++ b/py/private/browsers.bzl @@ -28,6 +28,12 @@ chrome_args = select({ }) + headless_args edge_args = select({ + "@selenium//common:use_pinned_linux_edge": [ + "--driver-binary=$(location @linux_edgedriver//:msedgedriver)", + "--browser-binary=$(location @linux_edge//:opt/microsoft/msedge/microsoft-edge)", + "--browser-args=--disable-dev-shm-usage", + "--browser-args=--no-sandbox", + ], "@selenium//common:use_pinned_macos_edge": [ "--driver-binary=$(location @mac_edgedriver//:msedgedriver)", "--browser-binary='$(location @mac_edge//:Edge.app)/Contents/MacOS/Microsoft Edge'", @@ -56,7 +62,7 @@ BROWSERS = { "edge": { "args": ["--driver=edge"] + edge_args, "data": edge_data, - "tags": COMMON_TAGS + ["edge", "skip-remote"], + "tags": COMMON_TAGS + ["edge"], }, "firefox": { "args": ["--driver=firefox"] + firefox_args, diff --git a/py/pytest.ini b/py/pytest.ini index e84b365d7490e..2ebd25acb38b7 100644 --- a/py/pytest.ini +++ b/py/pytest.ini @@ -5,7 +5,7 @@ log_cli = True trio_mode = true markers = xfail_chrome: Tests expected to fail in Chrome - xfail_chromiumedge: Tests expected to fail in Chromium Edge + xfail_edge: Tests expected to fail in Edge xfail_firefox: Tests expected to fail in Firefox xfail_ie: Tests expected to fail in IE xfail_remote: Tests expected to fail with Remote webdriver diff --git a/py/selenium/webdriver/remote/webdriver.py b/py/selenium/webdriver/remote/webdriver.py index bec4340891428..902af1af1f019 100644 --- a/py/selenium/webdriver/remote/webdriver.py +++ b/py/selenium/webdriver/remote/webdriver.py @@ -1046,7 +1046,7 @@ def _get_cdp_details(self): _firefox = False if self.caps.get("browserName") == "chrome": debugger_address = self.caps.get("goog:chromeOptions").get("debuggerAddress") - elif self.caps.get("browserName") == "msedge": + elif self.caps.get("browserName") == "MicrosoftEdge": debugger_address = self.caps.get("ms:edgeOptions").get("debuggerAddress") else: _firefox = True diff --git a/py/test/selenium/webdriver/common/alerts_tests.py b/py/test/selenium/webdriver/common/alerts_tests.py index 04dff8e029272..ea37e0e3d5371 100644 --- a/py/test/selenium/webdriver/common/alerts_tests.py +++ b/py/test/selenium/webdriver/common/alerts_tests.py @@ -141,7 +141,7 @@ def test_setting_the_value_of_an_alert_throws(driver, pages): @pytest.mark.xfail_chrome( condition=sys.platform == "darwin", reason="https://bugs.chromium.org/p/chromedriver/issues/detail?id=26", run=False ) -@pytest.mark.xfail_chromiumedge( +@pytest.mark.xfail_edge( condition=sys.platform == "darwin", reason="https://bugs.chromium.org/p/chromedriver/issues/detail?id=26", run=False ) def test_alert_should_not_allow_additional_commands_if_dimissed(driver, pages): @@ -250,7 +250,7 @@ def test_should_handle_alert_on_page_load_using_get(driver, pages): @pytest.mark.xfail_chrome(reason="Non W3C conformant") -@pytest.mark.xfail_chromiumedge(reason="Non W3C conformant") +@pytest.mark.xfail_edge(reason="Non W3C conformant") def test_should_handle_alert_on_page_before_unload(driver, pages): pages.load("pageWithOnBeforeUnloadMessage.html") @@ -293,6 +293,7 @@ def test_alert_should_not_allow_additional_commands_if_dismissed(driver, pages): @pytest.mark.xfail_firefox(reason="https://bugzilla.mozilla.org/show_bug.cgi?id=1279211") @pytest.mark.xfail_remote(reason="https://bugzilla.mozilla.org/show_bug.cgi?id=1279211") @pytest.mark.xfail_chrome +@pytest.mark.xfail_edge def test_unexpected_alert_present_exception_contains_alert_text(driver, pages): pages.load("alerts.html") driver.find_element(by=By.ID, value="alert").click() diff --git a/py/test/selenium/webdriver/common/driver_element_finding_tests.py b/py/test/selenium/webdriver/common/driver_element_finding_tests.py index 9a9944ef57004..f85d4fbeb6c1f 100644 --- a/py/test/selenium/webdriver/common/driver_element_finding_tests.py +++ b/py/test/selenium/webdriver/common/driver_element_finding_tests.py @@ -360,7 +360,7 @@ def test_finding_alink_by_xpath_using_contains_keyword_should_work(driver, pages # @pytest.mark.xfail_chrome(raises=InvalidSelectorException) -# @pytest.mark.xfail_chromiumedge(raises=InvalidSelectorException) +# @pytest.mark.xfail_edge(raises=InvalidSelectorException) # @pytest.mark.xfail_firefox(raises=InvalidSelectorException) # @pytest.mark.xfail_remote(raises=InvalidSelectorException) # @pytest.mark.xfail_safari(raises=NoSuchElementException) diff --git a/py/test/selenium/webdriver/common/element_attribute_tests.py b/py/test/selenium/webdriver/common/element_attribute_tests.py index 270b598c33502..a1717111c7b98 100644 --- a/py/test/selenium/webdriver/common/element_attribute_tests.py +++ b/py/test/selenium/webdriver/common/element_attribute_tests.py @@ -270,6 +270,7 @@ def test_should_return_true_for_present_boolean_attributes(driver, pages): @pytest.mark.xfail_chrome +@pytest.mark.xfail_edge @pytest.mark.xfail_firefox @pytest.mark.xfail_safari @pytest.mark.xfail_remote @@ -280,6 +281,7 @@ def test_should_get_unicode_chars_from_attribute(driver, pages): @pytest.mark.xfail_chrome +@pytest.mark.xfail_edge @pytest.mark.xfail_firefox @pytest.mark.xfail_safari @pytest.mark.xfail_remote diff --git a/py/test/selenium/webdriver/common/frame_switching_tests.py b/py/test/selenium/webdriver/common/frame_switching_tests.py index da22b5ea9e361..6e65b1f316ba8 100644 --- a/py/test/selenium/webdriver/common/frame_switching_tests.py +++ b/py/test/selenium/webdriver/common/frame_switching_tests.py @@ -230,6 +230,7 @@ def test_should_continue_to_refer_to_the_same_frame_once_it_has_been_selected(dr @pytest.mark.xfail_remote(raises=WebDriverException, reason="https://github.com/mozilla/geckodriver/issues/610") @pytest.mark.xfail_safari @pytest.mark.xfail_chrome +@pytest.mark.xfail_edge def test_should_focus_on_the_replacement_when_aframe_follows_alink_to_a_top_targeted_page(driver, pages): pages.load("frameset.html") driver.switch_to.frame(0) @@ -383,7 +384,7 @@ def test_should_be_able_to_switch_to_the_top_if_the_frame_is_deleted_from_under_ # @pytest.mark.xfail_chrome(raises=NoSuchElementException) -# @pytest.mark.xfail_chromiumedge(raises=NoSuchElementException) +# @pytest.mark.xfail_edge(raises=NoSuchElementException) # @pytest.mark.xfail_firefox(raises=WebDriverException, # reason='https://github.com/mozilla/geckodriver/issues/614') # @pytest.mark.xfail_remote(raises=WebDriverException, diff --git a/py/test/selenium/webdriver/common/page_loading_tests.py b/py/test/selenium/webdriver/common/page_loading_tests.py index 93c9b54d7c655..e7cfeea430c12 100644 --- a/py/test/selenium/webdriver/common/page_loading_tests.py +++ b/py/test/selenium/webdriver/common/page_loading_tests.py @@ -121,7 +121,7 @@ def test_should_wait_for_document_to_be_loaded(driver, pages): # @pytest.mark.xfail_firefox(run=False) # @pytest.mark.xfail_remote(run=False) # @pytest.mark.xfail_chrome(run=False) -# @pytest.mark.xfail_chromiumedge(run=False) +# @pytest.mark.xfail_edge(run=False) # def test_should_not_hang_if_document_open_call_is_never_followed_by_document_close_call(driver, pages): # pages.load("document_write_in_onload.html") # driver.find_element(By.XPATH, "//body") diff --git a/py/test/selenium/webdriver/common/position_and_size_tests.py b/py/test/selenium/webdriver/common/position_and_size_tests.py index 446c185d3df35..7ef1334a7a0f3 100644 --- a/py/test/selenium/webdriver/common/position_and_size_tests.py +++ b/py/test/selenium/webdriver/common/position_and_size_tests.py @@ -63,7 +63,7 @@ def test_should_scroll_page_and_get_coordinates_of_an_element_that_is_out_of_vie @pytest.mark.xfail_chrome -@pytest.mark.xfail_chromiumedge +@pytest.mark.xfail_edge @pytest.mark.xfail_firefox @pytest.mark.xfail_remote @pytest.mark.xfail_safari @@ -76,7 +76,7 @@ def test_should_get_coordinates_of_an_element_in_aframe(driver, pages): @pytest.mark.xfail_chrome -@pytest.mark.xfail_chromiumedge +@pytest.mark.xfail_edge @pytest.mark.xfail_firefox @pytest.mark.xfail_remote @pytest.mark.xfail_safari diff --git a/py/test/selenium/webdriver/common/upload_tests.py b/py/test/selenium/webdriver/common/upload_tests.py index 9cca2a4d5979c..f5521abd50fd8 100644 --- a/py/test/selenium/webdriver/common/upload_tests.py +++ b/py/test/selenium/webdriver/common/upload_tests.py @@ -58,6 +58,7 @@ def test_can_upload_two_files(driver, pages, get_local_path): @pytest.mark.xfail_firefox @pytest.mark.xfail_chrome +@pytest.mark.xfail_edge @pytest.mark.xfail_safari def test_file_is_uploaded_to_remote_machine_on_select(driver, pages, get_local_path): uploaded_files = [] diff --git a/py/test/selenium/webdriver/common/window_tests.py b/py/test/selenium/webdriver/common/window_tests.py index d30f3ffcf3acd..8b2774262603c 100644 --- a/py/test/selenium/webdriver/common/window_tests.py +++ b/py/test/selenium/webdriver/common/window_tests.py @@ -21,7 +21,7 @@ from selenium.webdriver.support.wait import WebDriverWait # @pytest.mark.xfail_ie -# @pytest.mark.xfail_chromiumedge(reason="Fails on Travis") +# @pytest.mark.xfail_edge(reason="Fails on Travis") # @pytest.mark.xfail_firefox(reason="Fails on Travis") # @pytest.mark.xfail_remote(reason="Fails on Travis") # def test_should_maximize_the_window(driver): diff --git a/rake_tasks/selenium_rake/browsers.rb b/rake_tasks/selenium_rake/browsers.rb index a73878fa5bd36..dca18f5b4191a 100644 --- a/rake_tasks/selenium_rake/browsers.rb +++ b/rake_tasks/selenium_rake/browsers.rb @@ -18,9 +18,6 @@ class Browsers 'chrome' => { driver: 'Chrome', }, - 'chromiumedge' => { - driver: 'ChromiumEdge', - }, 'remote_firefox' => { driver: 'Remote', deps: [