Skip to content

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

Remove test

Magnus Müllerbb8b801b5a0d
diff --git a/tests/ci/test_actor_page_press.py b/tests/ci/test_actor_page_press.py
index aa33ae086..65475c457 100644
--- a/tests/ci/test_actor_page_press.py
+++ b/tests/ci/test_actor_page_press.py
@@ -216,72 +216,6 @@ async def test_press_key_combinations(browser_session, httpserver: HTTPServer):
assert a_down_events[0]['ctrlKey'] is True, 'Control modifier should be active when pressing "a"'
-async def test_press_letter_keys(browser_session, httpserver: HTTPServer):
- """Test that letter keys work correctly."""
- html_content = """
- <!DOCTYPE html>
- <html>
- <head>
- <title>Letter Key Test</title>
- </head>
- <body>
- <div id="output">Ready</div>
- <script>
- const output = document.getElementById('output');
- const pressedKeys = [];
-
- document.addEventListener('keydown', (e) => {
- pressedKeys.push({
- key: e.key,
- code: e.code
- });
- output.textContent = JSON.stringify(pressedKeys);
- });
- </script>
- </body>
- </html>
- """
-
- httpserver.expect_request('/').respond_with_data(html_content, content_type='text/html')
- test_url = httpserver.url_for('/')
-
- page = await browser_session.new_page(test_url)
-
- import asyncio
-
- await asyncio.sleep(0.5)
-
- # Press letter keys
- await page.press('a')
- await asyncio.sleep(0.2)
- await page.press('B')
- await asyncio.sleep(0.2)
-
- # Get the output
- output_text = await page.evaluate('() => document.getElementById("output").textContent')
-
- print(f'DEBUG: Evaluating JavaScript: {repr(output_text)!r}')
-
- import json
-
- # Handle empty output gracefully
- if not output_text or output_text.strip() == '':
- # Wait a bit longer and try again
- await asyncio.sleep(0.5)
- output_text = await page.evaluate('() => document.getElementById("output").textContent')
- print(f'DEBUG: Second attempt: {repr(output_text)!r}')
-
- pressed_keys = json.loads(output_text)
-
- # Verify letter keys
- assert len(pressed_keys) == 2
-
- assert pressed_keys[0]['key'] == 'a'
- assert pressed_keys[0]['code'] == 'KeyA'
-
- assert pressed_keys[1]['key'] == 'B'
- assert pressed_keys[1]['code'] == 'KeyB'
-
async def test_press_arrow_keys_game_simulation(browser_session, httpserver: HTTPServer):
"""Test arrow keys in a 2048-like game scenario."""