feat: support network event listening on Page#37
Conversation
|
Thanks for this contribution! The implementation follows existing patterns well. A couple of design points to discuss: Unconditional network event subscriptionsThe PR subscribes to Test event ordering assumptionThe test asserts exact event ordering with |
|
Thank you for the reminder and suggestions! Since I'm just getting started with Regarding the test event ordering, that was an oversight on my part. I don't have a better solution at the moment (perhaps |
- Add `on_request`, `on_response`, `on_request_finished`, and `on_request_failed` methods to `Page` - Enhance `ResponseObject` with `status`, `status_text`, and `url` accessors - Add `update_subscription` helper method to `Channel` - Add integration test `test_page_support_network_events` to verify network event handling
- Remove automatic subscription to network events in BrowserContext - Update Page handlers to enable subscription only when the first handler is registered - Move network event tests to page_event_network.rs - Add test case for iframe network events - Add frame_handler in TestServer for iframe testing
…ted tests have been moved to `crates/playwright/tests/integration/page_event_network.rs`
93d8bf9 to
10d8a9b
Compare
on_request,on_response,on_request_finished, andon_request_failedmethods toPageBrowserContextviadispatch_request_eventanddispatch_response_eventResponseObjectwithstatus,status_text, andurlaccessorsBrowserContextto useChannel::update_subscriptionupdate_subscriptionhelper method toChanneltest_page_support_network_eventsto verify network event handling