Skip to content

[BUGS] Current Bugs of Patchright #30

@Vinyzu

Description

@Vinyzu

These are the current Bugs of Patchright, sorted by Type

Note

For Setup Convienience Reasons, Patchright is currently mainly tested on the Playwright Python Pytest Cases. The Failing Test Cases therefore link to these Python Tests. See the Automatic Patchright Chromium Test

Console (32 Failing Tests)

Explanation: Patchright disabled the Console CDP Domain as it causes full detection. There no current plans/ways to circumvent this detection. This Bug affects the following Playwright Features: ConsoleMessage, PageError.

Failing Test Cases

test_browsercontext_service_worker_policy.py::test_block_blocks_service_worker_registration
test_browsercontext_events.py::test_console_event_should_work
test_browsercontext_events.py::test_console_event_should_work_in_popup
test_browsercontext_events.py::test_console_event_should_work_in_popup_2
test_browsercontext_events.py::test_console_event_should_work_in_immediately_closed_popup
test_browsercontext_events.py::test_dialog_event_should_work_in_immdiately_closed_popup
test_browsercontext_events.py::test_console_event_should_work_with_context_manager
test_browsercontext_events.py::test_page_error_event_should_work
test_browsercontext_events.py:: test_weberror_event_should_work
test_console.py::test_console_should_work
test_console.py::test_console_should_emit_same_log_twice
test_console.py::test_console_should_use_text_for__str__
test_console.py::test_console_should_work_for_different_console_api_calls
test_console.py::test_console_should_not_fail_for_window_object
test_console.py::test_console_should_trigger_correct_log
test_console.py::test_console_should_have_location_for_console_api_calls
test_console.py::test_console_should_not_throw_when_there_are_console_messages_in_detached_iframes
test_click.py::test_click_offscreen_buttons
test_geolocation.py::test_watch_position_should_be_notified
test_page.py::test_page_error_should_fire
test_page.py::test_page_error_should_handle_odd_values
test_page.py::test_page_error_should_handle_object
test_page.py::test_page_error_should_handle_window
test_page.py::test_page_error_should_pass_error_name_property
test_sync.py::test_console_repr
test_tracing.py::test_should_collect_trace_with_resources_but_no_js
test_tracing.py::test_should_work_with_playwright_context_managers
test_tracing.py::test_should_respect_traces_dir_and_name
test_tracing.py::test_should_show_tracing_group_in_action_list
test_worker.py::test_workers_should_report_console_logs
test_worker.py::test_workers_should_have_JSHandles_for_console_logs
test_worker.py::test_workers_should_report_errors


Websocket Routing (6 Failing Tests)

Explanation: Probably not solvable stealthy without a custom MITM-Proxy. See Issue #31.

Failing Test Cases

test_route_web_socket.py::test_should_work_with_ws_close
test_route_web_socket.py::test_should_pattern_match
test_route_web_socket.py::test_should_work_with_server
test_route_web_socket.py::test_should_work_without_server
test_route_web_socket.py::test_should_work_with_base_url
test_route_web_socket.py::test_should_work_with_no_trailing_slash


InitScript Timing (4 Failing Tests)

Explanation: Patchright patches InitScripts by injecting custom script tags into the HTML. This causes some Timing issues, as the Script Tags take longer to load than normal InitScripts.

Failing Test Cases

test_browsercontext.py::test_expose_function_should_be_callable_from_inside_add_init_script
test_page.py::test_expose_function_should_be_callable_from_inside_add_init_script
test_page.py::test_expose_bindinghandle_should_work
test_popup.py::test_should_expose_function_from_browser_context


Disable Popup Blocking (1 Failing Test)

Explanation: Patchright patches Popup crashing by removing the --disable-popup-blocking defaultArg. If you have trouble with this issue and dont worry about Popup Crashing you can re-enable this feature by passing args=["--disable-popup-blocking"]

Failing Test Cases

test_browsercontext.py::test_page_event_should_have_an_opener


Mismatching Request Headers due to Routing (3 Failing Tests)

Explanation: This Bug mainly affects when adding an InitScript. This is a Playwright issue (youll get the same issue when routing normally), affecting returned Request Headers Client-Side. So this doesnt cause any detections. If you need correct Request Headers, youll have to create an issue in the Playwright Repository.

Failing Test Cases

test_network.py::test_request_headers_should_get_the_same_headers_as_the_server
test_network.py::test_request_headers_should_get_the_same_headers_as_the_server_cors
test_network.py::test_should_report_request_headers_array




Unwanted Behaviour

InitScripts on about:blank (Unwanted Behaviour)

Explanation: Because Patchright InitScripts use Routing, they cant affect about:blank, data:text/html,[...] and other Data-URIs. In Patchright Testing, this is solved by just going to an URL with an empty page, for example google.com/blank.html

Failing Test Cases

test_add_init_script.py::test_add_init_script_evaluate_before_anything_else_on_the_page
test_add_init_script.py::test_add_init_script_work_with_a_path
test_add_init_script.py::test_add_init_script_work_with_content
test_add_init_script.py::test_add_init_script_work_with_browser_context_scripts
test_add_init_script.py::test_add_init_script_work_with_browser_context_scripts_with_a_path
test_add_init_script.py::test_add_init_script_work_with_browser_context_scripts_for_already_created_pages
test_add_init_script.py::test_add_init_script_support_multiple_scripts
test_add_init_script.py::test_should_work_with_trailing_comments
test_wait_for_function.py::test_should_work_when_resolved_right_before_execution_context_disposal
test_page_clock.py::test_should_run_time_before_popup
test_page_clock.py::test_should_not_run_time_before_popup_on_pause
test_page_clock.py::test_should_progress_time
test_page_clock.py::test_should_run_for
test_page_clock.py::test_should_fast_forward
test_page_clock.py::test_should_fast_forward_to
test_page_clock.py::test_should_pause
test_page_clock.py::test_should_pause_and_fast_forward
test_page_clock.py::test_should_set_system_time_on_pause
test_page_clock.py::test_fast_forward_should_not_run_nested_immediate
test_page_clock.py::test_run_for_should_not_run_nested_immediate
test_page_clock.py::test_run_for_should_not_run_nested_immediate_from_microtask

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions