Skip to content

Commit d556045

Browse files
[py] marked some element finding tests to xfail in safari (#12500)
1 parent b89fb5e commit d556045

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

py/test/selenium/webdriver/common/driver_element_finding_tests.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ def test_should_not_be_able_to_locate_by_tag_name_multiple_elements_that_do_not_
192192

193193
@pytest.mark.xfail_firefox(reason="https://github.com/mozilla/geckodriver/issues/2007")
194194
@pytest.mark.xfail_remote(reason="https://github.com/mozilla/geckodriver/issues/2007")
195+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises NoSuchElementException")
195196
def test_finding_asingle_element_by_empty_tag_name_should_throw(driver, pages):
196197
pages.load("formPage.html")
197198
with pytest.raises(InvalidSelectorException):
@@ -200,6 +201,7 @@ def test_finding_asingle_element_by_empty_tag_name_should_throw(driver, pages):
200201

201202
@pytest.mark.xfail_firefox(reason="https://github.com/mozilla/geckodriver/issues/2007")
202203
@pytest.mark.xfail_remote(reason="https://github.com/mozilla/geckodriver/issues/2007")
204+
@pytest.mark.xfail_safari(reason="unlike chrome, safari returns an empty list")
203205
def test_finding_multiple_elements_by_empty_tag_name_should_throw(driver, pages):
204206
pages.load("formPage.html")
205207
with pytest.raises(InvalidSelectorException):
@@ -273,13 +275,15 @@ def test_should_not_find_element_by_class_when_the_name_queried_is_shorter_than_
273275
driver.find_element(By.CLASS_NAME, "name_B")
274276

275277

278+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
276279
def test_finding_asingle_element_by_empty_class_name_should_throw(driver, pages):
277280
pages.load("xhtmlTest.html")
278281
msg = r"\/errors#invalid-selector-exception"
279282
with pytest.raises(InvalidSelectorException, match=msg):
280283
driver.find_element(By.CLASS_NAME, "")
281284

282285

286+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
283287
def test_finding_multiple_elements_by_empty_class_name_should_throw(driver, pages):
284288
pages.load("xhtmlTest.html")
285289
with pytest.raises(InvalidSelectorException):
@@ -292,12 +296,14 @@ def test_finding_asingle_element_by_compound_class_name_should_throw(driver, pag
292296
driver.find_element(By.CLASS_NAME, "a b")
293297

294298

299+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
295300
def test_finding_asingle_element_by_invalid_class_name_should_throw(driver, pages):
296301
pages.load("xhtmlTest.html")
297302
with pytest.raises(InvalidSelectorException):
298303
driver.find_element(By.CLASS_NAME, "!@#$%^&*")
299304

300305

306+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
301307
def test_finding_multiple_elements_by_invalid_class_name_should_throw(driver, pages):
302308
pages.load("xhtmlTest.html")
303309
with pytest.raises(InvalidSelectorException):
@@ -380,6 +386,7 @@ def test_should_throw_an_exception_when_there_is_no_link_to_click(driver, pages)
380386
driver.find_element(By.XPATH, "//a[@id='Not here']")
381387

382388

389+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
383390
def test_should_throw_invalid_selector_exception_when_xpath_is_syntactically_invalid_in_driver_find_element(
384391
driver, pages
385392
):
@@ -388,6 +395,7 @@ def test_should_throw_invalid_selector_exception_when_xpath_is_syntactically_inv
388395
driver.find_element(By.XPATH, "this][isnot][valid")
389396

390397

398+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
391399
def test_should_throw_invalid_selector_exception_when_xpath_is_syntactically_invalid_in_driver_find_elements(
392400
driver, pages
393401
):
@@ -396,6 +404,7 @@ def test_should_throw_invalid_selector_exception_when_xpath_is_syntactically_inv
396404
driver.find_elements(By.XPATH, "this][isnot][valid")
397405

398406

407+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
399408
def test_should_throw_invalid_selector_exception_when_xpath_is_syntactically_invalid_in_element_find_element(
400409
driver, pages
401410
):
@@ -405,6 +414,7 @@ def test_should_throw_invalid_selector_exception_when_xpath_is_syntactically_inv
405414
body.find_element(By.XPATH, "this][isnot][valid")
406415

407416

417+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
408418
def test_should_throw_invalid_selector_exception_when_xpath_is_syntactically_invalid_in_element_find_elements(
409419
driver, pages
410420
):
@@ -414,25 +424,29 @@ def test_should_throw_invalid_selector_exception_when_xpath_is_syntactically_inv
414424
body.find_elements(By.XPATH, "this][isnot][valid")
415425

416426

427+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
417428
def test_should_throw_invalid_selector_exception_when_xpath_returns_wrong_type_in_driver_find_element(driver, pages):
418429
pages.load("formPage.html")
419430
with pytest.raises(InvalidSelectorException):
420431
driver.find_element(By.XPATH, "count(//input)")
421432

422433

434+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
423435
def test_should_throw_invalid_selector_exception_when_xpath_returns_wrong_type_in_driver_find_elements(driver, pages):
424436
pages.load("formPage.html")
425437
with pytest.raises(InvalidSelectorException):
426438
driver.find_elements(By.XPATH, "count(//input)")
427439

428440

441+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
429442
def test_should_throw_invalid_selector_exception_when_xpath_returns_wrong_type_in_element_find_element(driver, pages):
430443
pages.load("formPage.html")
431444
body = driver.find_element(By.TAG_NAME, "body")
432445
with pytest.raises(InvalidSelectorException):
433446
body.find_element(By.XPATH, "count(//input)")
434447

435448

449+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
436450
def test_should_throw_invalid_selector_exception_when_xpath_returns_wrong_type_in_element_find_elements(driver, pages):
437451
pages.load("formPage.html")
438452
body = driver.find_element(By.TAG_NAME, "body")
@@ -504,24 +518,28 @@ def test_should_not_find_elements_by_css_selector_when_there_is_no_such_element(
504518
assert len(elements) == 0
505519

506520

521+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
507522
def test_finding_asingle_element_by_empty_css_selector_should_throw(driver, pages):
508523
pages.load("xhtmlTest.html")
509524
with pytest.raises(InvalidSelectorException):
510525
driver.find_element(By.CSS_SELECTOR, "")
511526

512527

528+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
513529
def test_finding_multiple_elements_by_empty_css_selector_should_throw(driver, pages):
514530
pages.load("xhtmlTest.html")
515531
with pytest.raises(InvalidSelectorException):
516532
driver.find_elements(By.CSS_SELECTOR, "")
517533

518534

535+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
519536
def test_finding_asingle_element_by_invalid_css_selector_should_throw(driver, pages):
520537
pages.load("xhtmlTest.html")
521538
with pytest.raises(InvalidSelectorException):
522539
driver.find_element(By.CSS_SELECTOR, "//a/b/c[@id='1']")
523540

524541

542+
@pytest.mark.xfail_safari(reason="unlike chrome, safari raises TimeoutException")
525543
def test_finding_multiple_elements_by_invalid_css_selector_should_throw(driver, pages):
526544
pages.load("xhtmlTest.html")
527545
with pytest.raises(InvalidSelectorException):

0 commit comments

Comments
 (0)