Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

revert tests/ci/browser

Laith Weinbergerd646f2fbc0f1
diff --git a/tests/ci/browser/test_dom_serializer.py b/tests/ci/browser/test_dom_serializer.py
index ce03a0d2c..e91c9a33e 100644
--- a/tests/ci/browser/test_dom_serializer.py
+++ b/tests/ci/browser/test_dom_serializer.py
@@ -84,10 +84,9 @@ class TestDOMSerializer:
- Regular DOM: 3 elements (button, input, link on main page)
- Shadow DOM: 3 elements (2 buttons, 1 input inside shadow root)
- Same-origin iframe: 2 elements (button, input inside iframe)
- - AntD-like controls: 2 elements (labels wrapping radio inputs)
- Cross-origin iframe placeholder: about:blank (no interactive elements)
- Iframe tags: 2 elements (the iframe elements themselves)
- Total: ~14 interactive elements
+ Total: ~10 interactive elements
"""
from browser_use.tools.service import Tools
@@ -156,7 +155,6 @@ class TestDOMSerializer:
shadow_elements = []
iframe_content_elements = []
iframe_tags = []
- antd_elements = []
# Categorize elements by their IDs (more stable than hardcoded indices)
# Check element attributes to identify their location
@@ -173,8 +171,6 @@ class TestDOMSerializer:
# Iframe content elements have IDs starting with "iframe-"
elif elem_id.startswith('iframe-'):
iframe_content_elements.append((idx, element))
- elif elem_id.startswith('antd-'):
- antd_elements.append((idx, element))
# Everything else is regular DOM
else:
regular_elements.append((idx, element))
@@ -186,9 +182,8 @@ class TestDOMSerializer:
# - Regular DOM: 3-4 elements (button, input, link on main page + possible cross-origin content)
# - Shadow DOM: 3 elements (2 buttons, 1 input inside shadow root)
# - Iframe content: 2 elements (button, input from same-origin iframe)
- # - AntD-like controls: 2+ elements (labels + inputs)
# - Iframe tags: 2 elements (the iframe elements themselves)
- # Total: ~14 interactive elements depending on cross-origin iframe extraction
+ # Total: ~10-11 interactive elements depending on cross-origin iframe extraction
print('\n✅ DOM Serializer Test Summary:')
print(f' • Regular DOM: {len(regular_elements)} elements {"✓" if len(regular_elements) >= 3 else "✗"}')
@@ -196,7 +191,6 @@ class TestDOMSerializer:
print(
f' • Same-origin iframe content: {len(iframe_content_elements)} elements {"✓" if len(iframe_content_elements) >= 2 else "✗"}'
)
- print(f' • AntD-like controls: {len(antd_elements)} elements {"✓" if len(antd_elements) >= 2 else "✗"}')
print(f' • Iframe tags: {len(iframe_tags)} elements {"✓" if len(iframe_tags) >= 2 else "✗"}')
print(f' • Total elements: {len(selector_map)}')
@@ -207,7 +201,6 @@ class TestDOMSerializer:
assert len(iframe_content_elements) >= 1, (
f'Should find at least 1 iframe content element, found {len(iframe_content_elements)}'
)
- assert len(antd_elements) >= 2, f'Should find at least 2 AntD-like label elements, found {len(antd_elements)}'
# Now test clicking elements from each category using tools.click(index)
print('\n🖱️ Testing Click Functionality:')
@@ -243,12 +236,7 @@ class TestDOMSerializer:
if iframe_button_idx:
await click(iframe_button_idx, 'Same-origin iframe button', browser_session)
- # Test clicking an AntD-like label wrapper
- if antd_elements:
- antd_label_idx = next((idx for idx, el in antd_elements if el.tag_name == 'label'), None) or antd_elements[0][0]
- await click(antd_label_idx, 'AntD-like label', browser_session)
-
- # Validate click counter - verify all 4 clicks actually executed JavaScript
+ # Validate click counter - verify all 3 clicks actually executed JavaScript
print('\n✅ Validating click counter...')
# Get the CDP session for the main page (use target from a regular DOM element)
@@ -269,8 +257,8 @@ class TestDOMSerializer:
click_count = result.get('result', {}).get('value', 0)
print(f' Click counter value: {click_count}')
- assert click_count == 4, (
- f'Expected 4 clicks (Regular DOM + Shadow DOM + Iframe + AntD-like label), but counter shows {click_count}. '
+ assert click_count == 3, (
+ f'Expected 3 clicks (Regular DOM + Shadow DOM + Iframe), but counter shows {click_count}. '
f'This means some clicks did not execute JavaScript properly.'
)
diff --git a/tests/ci/browser/test_page_template.html b/tests/ci/browser/test_page_template.html
index 5081dabb1..cde8e161f 100644
--- a/tests/ci/browser/test_page_template.html
+++ b/tests/ci/browser/test_page_template.html
@@ -59,23 +59,6 @@
<iframe id="same-origin-iframe" src="/iframe-same-origin" style="width:100%; height:200px; border:1px solid #999;"></iframe>
</div>
- <!-- Ant Design-like components (labels wrapping inputs with spans) -->
- <div class="section" id="antd-section">
- <h2>Ant Design-like Controls</h2>
- <label class="ant-radio-button-wrapper" id="antd-radio-1">
- <span class="ant-radio-button">
- <input type="radio" class="ant-radio-button-input" name="demoRadio" id="antd-radio-input-1" />
- </span>
- <span class="ant-radio-label">AntD Option A</span>
- </label>
- <label class="ant-radio-button-wrapper" id="antd-radio-2">
- <span class="ant-radio-button">
- <input type="radio" class="ant-radio-button-input" name="demoRadio" id="antd-radio-input-2" />
- </span>
- <span class="ant-radio-label">AntD Option B</span>
- </label>
- </div>
-
<!-- Cross-origin iframe placeholder (external domain removed for test isolation) -->
<div class="section">
<h2>Cross-Origin Iframe (Placeholder)</h2>
@@ -130,11 +113,6 @@
shadowRoot.getElementById('shadow-btn-1').addEventListener('click', function() {
incrementCounter('Shadow DOM');
});
-
- // Add click handlers for Ant Design-like labels
- document.querySelectorAll('.ant-radio-button-wrapper').forEach((label) => {
- label.addEventListener('click', () => incrementCounter('AntD'));
- });
</script>
</body>
</html>