Skip to content

Commit 333314b

Browse files
committed
[WebDriver] Update imported selenium tests, 202504 edition
https://bugs.webkit.org/show_bug.cgi?id=291616 Reviewed by Carlos Garcia Campos. - Selenium updated to 963bf958 (4.32 nightly) - Includes new bidi browser and network tests - Fix usage of `--bidi` pytest option after [1] - Drive-by gardening [1] SeleniumHQ/selenium#15567 * Tools/Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py: (WebDriverSeleniumExecutor.__init__): Fix usage of `--bidi` pytest option. * WebDriverTests/TestExpectations.json: * WebDriverTests/imported/selenium/common/src/web/bidi/logEntryAdded.html: * WebDriverTests/imported/selenium/common/src/web/cookie-background.html: Added. * WebDriverTests/imported/selenium/common/src/web/formPage.html: * WebDriverTests/imported/selenium/common/src/web/logEntryAdded.html: * WebDriverTests/imported/selenium/common/src/web/relative_locators.html: * WebDriverTests/imported/selenium/common/src/web/service-worker.js: Added. * WebDriverTests/imported/selenium/common/src/web/service_worker.html: Added. * WebDriverTests/imported/selenium/importer.json: * WebDriverTests/imported/selenium/py/conftest.py: * WebDriverTests/imported/selenium/py/selenium/__init__.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/__init__.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/actions/action_builder.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/bidi/browser.py: Added. * WebDriverTests/imported/selenium/py/selenium/webdriver/common/bidi/network.py: Added. * WebDriverTests/imported/selenium/py/selenium/webdriver/common/by.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/log.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/options.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/print_page_options.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/proxy.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/service.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/timeouts.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/common/utils.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/locator_converter.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/shadowroot.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webdriver.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/remote/websocket_connection.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/safari/options.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/support/expected_conditions.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/support/relative_locator.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/support/select.py: * WebDriverTests/imported/selenium/py/selenium/webdriver/support/wait.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/bidi_browser_tests.py: Added. * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/bidi_network_tests.py: Added. * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/cookie_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/fedcm_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/selenium_manager_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/w3c_interaction_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/remote/remote_downloads_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/safari/safari_service_tests.py: * WebDriverTests/imported/selenium/py/test/selenium/webdriver/support/relative_by_tests.py: Canonical link: https://commits.webkit.org/293953@main
1 parent aab018b commit 333314b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3227
-863
lines changed

Tools/Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, port, driver, env):
4343

4444
self._args = []
4545
if self._port.get_option('enable_webdriver_bidi'):
46-
self._args.append('--bidi=1')
46+
self._args.append('--bidi')
4747

4848
self._args.extend(['--driver=%s' % self._driver_name, '--driver-binary=%s' % driver.binary_path()])
4949
browser_path = driver.browser_path()

WebDriverTests/TestExpectations.json

Lines changed: 73 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,28 @@
2828
"imported/selenium/py/test/selenium/webdriver/common/appcache_tests.py": {
2929
"expected": {"all": {"status": ["SKIP"]}}
3030
},
31+
32+
"imported/selenium/py/test/selenium/webdriver/common/bidi_browser_tests.py": {
33+
"subtests": {
34+
"test_create_user_context": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288104"}}},
35+
"test_get_user_contexts": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288107"}}},
36+
"test_remove_user_context": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288108"}}},
37+
"test_get_client_windows": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288106"}}}
38+
}
39+
},
40+
41+
"imported/selenium/py/test/selenium/webdriver/common/bidi_network_tests.py": {
42+
"subtests": {
43+
"test_add_intercept": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288087"}}},
44+
"test_remove_intercept": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288094"}}},
45+
"test_add_and_remove_request_handler": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288087"}}},
46+
"test_clear_request_handlers": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288094"}}},
47+
"test_continue_request": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288088"}}},
48+
"test_continue_with_auth": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288091"}}},
49+
"test_remove_auth_handler": { "expected": { "all": { "status": ["FAIL"], "bug": "webkit.org/b/288094"}}}
50+
}
51+
},
52+
3153
"imported/selenium/py/test/selenium/webdriver/common/fedcm_tests.py": {
3254
"expected": {"all": {"status": ["SKIP"], "note": "FEDCM is not supported in WebKit"}}
3355
},
@@ -70,35 +92,74 @@
7092
},
7193
"test_should_not_delete_cookies_with_asimilar_name": {
7294
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/279079"}}
95+
},
96+
"test_delete_cookie_raises_value_error_for_empty_name": {
97+
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/279079"}}
7398
}
7499
}
75100
},
76-
"imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py": {
101+
102+
"imported/selenium/py/test/selenium/webdriver/common/element_attribute_tests.py": {
77103
"subtests": {
78-
"testShouldNotSwitchMagicallyToTheTopWindow": {
79-
"expected": {"all": {"slow": true}}
104+
"test_can_retrieve_the_current_value_of_atext_form_field_email_input": {
105+
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/212953"}}
80106
},
81-
"testShouldFocusOnTheReplacementWhenAFrameFollowsALinkToA_TopTargetedPage": {
82-
"expected": {"all": {"status": ["FAIL"], "reason": "Marked fail upstream through annotations for remote and safari."}}
107+
"test_should_get_unicode_chars_from_attribute": {
108+
"expected": {"all": {"status": ["FAIL"], "note": "Likely issue in upstream test, failing other browsers too"}}
83109
},
84-
"testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs": {
85-
"expected": {"all": {"status": ["FAIL"], "reason": "Marked fail upstream through annotations for gtk and safari."}}
110+
"test_should_get_values_and_not_miss_items": {
111+
"expected": {"all": {"status": ["FAIL"], "note": "Likely issue in upstream test, failing other browsers too"}}
86112
}
87113
}
88114
},
115+
116+
"imported/selenium/py/test/selenium/webdriver/common/form_handling_tests.py": {
117+
"subtests": {
118+
"test_should_be_able_to_enter_text_into_atext_area_by_setting_its_value": {
119+
"expected": {"wpe": {"status": ["FAIL"], "bug": "webkit.org/b/279342"}}
120+
},
121+
"test_sending_keyboard_events_should_append_text_in_inputs": {
122+
"expected": {"wpe": {"status": ["FAIL"], "bug": "webkit.org/b/279342"}}
123+
}
124+
}
125+
},
126+
127+
"imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py": {
128+
"subtests": {
129+
"test_should_focus_on_the_replacement_when_aframe_follows_alink_to_a_top_targeted_page": {
130+
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/291586"}}
131+
}
132+
}
133+
},
134+
89135
"imported/selenium/py/test/selenium/webdriver/common/interactions_tests.py": {
90136
"subtests": {
91-
"testClickingOnFormElements": {
137+
"test_clicking_on_form_elements": {
92138
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
93139
},
94-
"testDoubleClick": {
140+
"test_context_click": {
141+
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/291615"}}
142+
},
143+
"test_double_click": {
95144
"expected": {"wpe": {"status": ["FAIL"], "bug": "webkit.org/b/174674"}}
96145
},
97-
"testSelectingMultipleItems": {
146+
"test_drag_and_drop": {
147+
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/291615"}}
148+
},
149+
"test_dragging_element_with_mouse_fires_events": {
150+
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/291615"}}
151+
},
152+
"test_dragging_element_with_mouse_moves_it_to_another_list": {
153+
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/291615"}}
154+
},
155+
"test_move_and_click": {
156+
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/291615"}}
157+
},
158+
"test_selecting_multiple_items": {
98159
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
99160
},
100-
"testSendingKeysToActiveElementWithModifier": {
101-
"expected": {"wpe": {"status": ["FAIL"], "bug": "webkit.org/b/215588"}}
161+
"test_sending_keys_to_active_element_with_modifier": {
162+
"expected": {"wpe": {"status": ["FAIL"], "bug": "webkit.org/b/279342"}}
102163
}
103164
}
104165
},

WebDriverTests/imported/selenium/common/src/web/bidi/logEntryAdded.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<body>
44

5-
<h1>Long entry added events</h1>
5+
<h1>Log entry added events</h1>
66

77
<button id="consoleLog" onclick="helloWorld()">Click me for console logs</button>
88

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Cookie Demo</title>
7+
<script>
8+
function setTheme(theme) {
9+
document.cookie = "theme=" + theme + "; path=/; SameSite=None; Secure"
10+
applyTheme()
11+
}
12+
13+
function getCookie(name) {
14+
let match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'))
15+
return match ? match[2] : null
16+
}
17+
18+
function applyTheme() {
19+
let theme = getCookie("theme")
20+
document.body.style.backgroundColor = theme || "white"
21+
}
22+
23+
window.onload = applyTheme
24+
</script>
25+
</head>
26+
<body>
27+
<h1>Cookie-Based Demo</h1>
28+
<button id="blue-btn" onclick="setTheme('lightblue')">Light Blue</button>
29+
<button id="green-btn" onclick="setTheme('lightgreen')">Light Green</button>
30+
<button id="reset-btn" onclick="setTheme('white')">Reset</button>
31+
<p>Open this page in multiple tabs/windows to see the shared cookie behavior.</p>
32+
<p>If you open it in a separate user context, the theme will reset.</p>
33+
</body>
34+
</html>

WebDriverTests/imported/selenium/common/src/web/formPage.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@
8282

8383
<select id="invisible_multi_select" multiple>
8484
<option selected="selected" value="apples" style="opacity: 0;">Apples</option>
85-
<option value="oranges">Oranges</option>
86-
<option selected="selected" value="lemons">Lemons</option>
85+
<option value="pears" style="opacity: 0.0;">Pears</option>
86+
<option value="oranges" style="display: none;">Oranges</option>
87+
<option selected="selected" value="lemons" style="visibility: hidden;">Lemons</option>
8788
</select>
8889

8990
<select name="select-default">

WebDriverTests/imported/selenium/common/src/web/logEntryAdded.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<body>
44

5-
<h1>Long entry added events</h1>
5+
<h1>Log entry added events</h1>
66

77
<button id="consoleLog" onclick="helloWorld()">Click me for console logs</button>
88

Lines changed: 72 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
<html>
1+
<html lang="en">
32
<head>
43
<title>Relative Locators</title>
54
<style>
@@ -10,57 +9,101 @@
109
td {
1110
border: solid;
1211
}
13-
.small-rectangle {
12+
#center {
13+
width: 100px;
14+
}
15+
#rectangles {
16+
position: relative;
17+
}
18+
#rectangles div {
19+
position: absolute;
20+
border: 1px solid black;
21+
height: 50px;
22+
width: 50px;
23+
}
24+
#a {
25+
left: 25px;
26+
top: 0;
27+
}
28+
#b {
29+
left: 78px;
30+
top: 30px;
31+
}
32+
#c {
33+
left: 131px;
34+
top: 60px;
35+
}
36+
#d {
37+
left: 0;
38+
top: 53px;
39+
}
40+
#e {
41+
left: 53px;
42+
top: 83px;
43+
}
44+
#f {
45+
left: 106px;
46+
top: 113px;
47+
}
48+
#proximity .small {
1449
border: 1px solid black;
1550
width: 100px;
1651
height: 50px;
1752
margin: 5px 25px;
1853
}
19-
.big-rectangle {
54+
#proximity .big {
2055
border: 1px solid black;
2156
width: 150px;
22-
height: 400px;
57+
height: 400px;
58+
}
59+
#rect3 {
60+
margin: 60px 25px;
2361
}
2462
</style>
2563
</head>
2664
<body>
2765
<h1>Relative Locator Tests</h1>
28-
<p id="above">This text is above.
29-
<p id="mid">This is a paragraph of text in the middle.
30-
<p id="below">This text is below.
31-
66+
<section id="paragraphs">
67+
<p id="above">This text is above.</p>
68+
<p id="mid">This is a paragraph of text in the middle.</p>
69+
<p id="below">This text is below.</p>
70+
</section>
3271

3372
<table>
3473
<tr>
35-
<td id="first">1</td>
36-
<td id="second" style="width: 100px">2</td>
37-
<td id="third">3</td>
74+
<td id="topLeft">1</td>
75+
<td id="top">2</td>
76+
<td id="topRight">3</td>
3877
</tr>
3978
<tr>
40-
<td id="fourth">4</td>
79+
<td id="left">4</td>
4180
<td id="center">5</td>
42-
<td id="sixth">6</td>
81+
<td id="right">6</td>
4382
</tr>
4483
<tr>
45-
<td id="seventh">7</td>
46-
<td id="eighth">8</td>
47-
<td id="ninth">9</td>
84+
<td id="bottomLeft">7</td>
85+
<td id="bottom">8</td>
86+
<td id="bottomRight">9</td>
4887
</tr>
4988
</table>
5089

51-
<div class="small-rectangle" id="rect1">
52-
Rectangle 1
53-
</div>
54-
<div class="big-rectangle" id="rect2">
55-
Rectangle 2, which is near Rectangle 1
56-
</div>
90+
<section id="rectangles">
91+
<div id="a">El-A</div>
92+
<div id="b">El-B</div>
93+
<div id="c">El-C</div>
94+
<div id="d">El-D</div>
95+
<div id="e">El-E</div>
96+
<div id="f">El-F</div>
97+
</section>
5798

58-
<div class="small-rectangle" style="margin:60px 25px" id="rect3">
59-
Rectangle 3
60-
</div>
61-
<div class="big-rectangle" id="rect4">
62-
Rectangle 4, which is not near Rectangle 2 because it is more than 50 px away
63-
</div>
99+
<section id="proximity">
100+
<div class="small" id="rect1">Rectangle 1</div>
101+
<div class="big" id="rect2">Rectangle 2, which is near Rectangle 1</div>
102+
<div class="small" id="rect3">Rectangle 3</div>
103+
<div class="big" id="rect4">
104+
Rectangle 4, which is not near Rectangle 2 because it is more than 50 px away
105+
</div>
106+
</section>
64107

65108
</body>
66109
</html>

WebDriverTests/imported/selenium/common/src/web/service-worker.js

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Service Worker Test Page</title>
5+
<script>
6+
if (navigator.serviceWorker) {
7+
navigator.serviceWorker.register("/service-worker.js", { scope: "/" })
8+
.then(() => navigator.serviceWorker.ready)
9+
.then(() => console.debug("[Companion]", "Service worker registered!"));
10+
}
11+
</script>
12+
</head>
13+
<body>
14+
<h1>This page loads a service worker</h1>
15+
</body>
16+
</html>

WebDriverTests/imported/selenium/importer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"repository": "https://github.com/SeleniumHQ/selenium.git",
3-
"revision": "7425162bbc9b7e747118a8ccffeb9efb5f6b8d37",
3+
"revision": "963bf958e6a320126b58c41bfddcf783fdc9e2b1",
44
"paths_to_import": [
55
"common",
66
"py/conftest.py",

0 commit comments

Comments
 (0)