diff --git a/py/test/selenium/webdriver/common/select_class_tests.py b/py/test/selenium/webdriver/common/select_class_tests.py index 875c962eab662..06b601555c01e 100644 --- a/py/test/selenium/webdriver/common/select_class_tests.py +++ b/py/test/selenium/webdriver/common/select_class_tests.py @@ -48,6 +48,7 @@ def test_select_by_index_single(driver, pages): assert sel.first_selected_option.text == select["values"][x] +@pytest.mark.xfail_safari(reason="options incorrectly reported as enabled") def test_raises_exception_select_by_index_single_disabled(driver, pages): pages.load("formPage.html") sel = Select(driver.find_element(By.NAME, disabledSingleSelect["name"])) @@ -64,6 +65,7 @@ def test_select_by_value_single(driver, pages): assert sel.first_selected_option.text == select["values"][x] +@pytest.mark.xfail_safari(reason="options incorrectly reported as enabled") def test_raises_exception_select_by_value_single_disabled(driver, pages): pages.load("formPage.html") sel = Select(driver.find_element(By.NAME, disabledSingleSelect["name"])) @@ -82,6 +84,7 @@ def test_select_by_visible_text_single(driver, pages): assert sel.first_selected_option.text == select["values"][x] +@pytest.mark.xfail_safari(reason="options incorrectly reported as enabled") def test_raises_exception_select_by_text_single_disabled(driver, pages): pages.load("formPage.html") sel = Select(driver.find_element(By.NAME, disabledSingleSelect["name"])) @@ -103,6 +106,7 @@ def test_select_by_index_multiple(driver, pages): assert selected[j].text == select["values"][j] +@pytest.mark.xfail_safari(reason="options incorrectly reported as enabled") def test_raises_exception_select_by_index_multiple_disabled(driver, pages): pages.load("formPage.html") @@ -125,6 +129,7 @@ def test_select_by_value_multiple(driver, pages): assert selected[j].text == select["values"][j] +@pytest.mark.xfail_safari(reason="options incorrectly reported as enabled") def test_raises_exception_select_by_value_multiple_disabled(driver, pages): pages.load("formPage.html") @@ -147,6 +152,7 @@ def test_select_by_visible_text_multiple(driver, pages): assert selected[j].text == select["values"][j] +@pytest.mark.xfail_safari(reason="options incorrectly reported as enabled") def test_raises_exception_select_by_text_multiple_disabled(driver, pages): pages.load("formPage.html") diff --git a/py/test/selenium/webdriver/safari/launcher_tests.py b/py/test/selenium/webdriver/safari/launcher_tests.py index 7117a9f4ba493..1d08a226d2fcd 100644 --- a/py/test/selenium/webdriver/safari/launcher_tests.py +++ b/py/test/selenium/webdriver/safari/launcher_tests.py @@ -19,6 +19,9 @@ import pytest +from selenium.common.exceptions import NoSuchDriverException +from selenium.webdriver.safari.service import Service + def test_launch(driver): assert driver.capabilities["browserName"] == "Safari" @@ -27,9 +30,9 @@ def test_launch(driver): def test_launch_with_invalid_executable_path_raises_exception(driver_class): path = "/this/path/should/never/exist" assert not os.path.exists(path) - with pytest.raises(Exception) as e: - driver_class(executable_path=path) - assert "are you running Safari 10 or later?" in str(e) + service = Service(executable_path=path) + with pytest.raises(NoSuchDriverException): + driver_class(service=service) @pytest.mark.skipif(