Skip to content

Commit

Permalink
[py] Run Edge tests on RBE
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Mar 15, 2024
1 parent 5bd908d commit e585d0f
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 19 deletions.
6 changes: 1 addition & 5 deletions py/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"remote",
"safari",
"webkitgtk",
"chromiumedge",
"wpewebkit",
)

Expand Down Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion py/private/browsers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion py/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/remote/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions py/test/selenium/webdriver/common/alerts_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions py/test/selenium/webdriver/common/element_attribute_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion py/test/selenium/webdriver/common/frame_switching_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion py/test/selenium/webdriver/common/page_loading_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions py/test/selenium/webdriver/common/position_and_size_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions py/test/selenium/webdriver/common/upload_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion py/test/selenium/webdriver/common/window_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 0 additions & 3 deletions rake_tasks/selenium_rake/browsers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class Browsers
'chrome' => {
driver: 'Chrome',
},
'chromiumedge' => {
driver: 'ChromiumEdge',
},
'remote_firefox' => {
driver: 'Remote',
deps: [
Expand Down

0 comments on commit e585d0f

Please sign in to comment.