Playwright Async Actions with Selenium Actions Parity and Browser Session Interoperability#657
Playwright Async Actions with Selenium Actions Parity and Browser Session Interoperability#657nasif-z wants to merge 58 commits into
Conversation
async/await
|
@claude Review the changes and suggest additional improvements - specially in regards to if something was missed with async/await. |
Partial match was not picking up action named "validate partial text"
05970f0 to
1f0e02d
Compare
Removes threading and uses async instead for `Thread_ScreenShot`
…d Chromium installation method
- Defaults to viewport instead of full page - Default image quality is now 70% - Skips `PIL` post-processing for Playwright
This comment was marked as outdated.
This comment was marked as outdated.
Avoid starting Playwright during Selenium browser launches and avoid creating Selenium CDP drivers during Playwright launches. Store session metadata with the remote debugging port and attach the opposite framework only when an action from that framework targets the session.
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed The async conversion is a good direction, but a few synchronous call sites were left behind and will now return coroutine objects instead of running browser actions. There is also a risky default behavior change in Playwright browser startup. → Security ReviewStatus: ✅ Completed No clear security regressions are introduced in the provided PR diff. The changes primarily refactor execution to async/await and add Playwright session routing without exposing a direct injection, auth, or secret-handling issue visible in the diff. → Performance ReviewStatus: ✅ Completed No performance regressions or scalability issues stood out in this PR diff. The changes are mostly async plumbing plus Playwright session routing, with no clear N+1, unbounded query, or memory-growth concerns visible from the code provided. → Testing ReviewStatus: ✅ Completed The PR adds substantial async/session-routing behavior in the browser automation path, but the test suite only covers a small slice of the new Playwright session helpers. The highest-risk regressions are currently unprotected by tests.
|
- Matches Selenium's `Get_Element` behaviour
* new actions added * clean code added * test case fixes * update on previous actions & new action open electron app added * bug fixes --------- Co-authored-by: Nazmul Ahsan <[email protected]> Co-authored-by: Nasif <[email protected]>
- Add missing Playwright action declarations and implementations - Align Playwright action parsing with Selenium step data formats - Improve locator shadow DOM parity and regression coverage - Add focused Playwright parity tests
- Add shared browser compatibility hydration before execute-python snippets run - Lazily bridge Selenium and Playwright sessions using existing CDP attachment paths - Support top-level await for async Playwright custom code while preserving sync snippets
- Read the running Playwright Chromium version from the CDP version endpoint - Prefer ZeuZ Chrome-for-Testing cached chromedriver before downloading with webdriver-manager - Attach Selenium with a matching ChromeDriver to avoid browser-version mismatch failures
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed The async conversion is mostly consistent, but two remaining synchronous call sites will break control flow: one loop helper still treats → Security ReviewStatus: ✅ Completed No high-confidence security issues in the PR diff. The changes are primarily async refactors and Playwright session-routing additions, with no clear new injection, authz, or secret-handling flaws introduced. → Performance ReviewStatus: ✅ Completed I found one significant performance risk in the new Playwright network logging path: captured requests are kept entirely in memory with no bound, and optional response-body capture can amplify memory use quickly on long or chatty pages. → Testing ReviewStatus: ✅ Completed The PR makes core dispatcher and Playwright execution paths async, but there are no regression tests covering those new control flows. I found the existing Playwright/session tests helpful, but they stop short of asserting the async dispatcher, browser-driver routing, and top-level-await Python execution behavior introduced here.
|
async/await- Await coroutine functions inside the logger decorator before logging exit. - Preserve existing sync logger behavior and custom fail message logging. - Add tests covering async log order, sync behavior, and fail messages.
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed The async refactor introduces a high-severity regression in loop execution, and there is another async callsite still invoking the sequential engine synchronously. → Security ReviewStatus: ✅ Completed No critical security regressions stand out in the PR diff. The changes are primarily async refactors and Playwright/Selenium interoperability enhancements, with no obvious new injection, authz, secret-handling, or path-traversal issues introduced. → Performance ReviewStatus: ✅ Completed No significant performance regressions or scalability issues stood out in the PR diff. → Testing ReviewStatus: ✅ Completed The PR changes the core async action dispatcher and Playwright/Selenium interoperability, but there are no added tests covering those new execution paths. That leaves the highest-risk behavior unverified, especially the async
|
- add lazy Get_Element resolution with timeout helper - pass wait values into high-frequency Playwright actions - avoid double wait in Wait_For_Element - cover lazy and resolved locator/action parity paths
- Await sequential loop and bypass handler execution - Run async sequential callbacks inside performance worker threads - Await Playwright page/session activation helpers - Execute async driver functions correctly in threaded runs - Await coroutine results returned by installer wrapper callables - Share sync session cleanup for CLI prompt path
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed I found one concrete regression in the new Playwright session routing and one broader API break from making the sequential runner async without updating all direct callers. → Security ReviewStatus: ✅ Completed No high-signal security regressions found in the PR diff. The changes mainly refactor Playwright/Selenium orchestration to async and add new browser actions without introducing an obvious injection, authz, or secret-handling flaw. → Performance ReviewStatus: ✅ Completed One performance risk: the new Playwright network logger buffers every matching request/response in memory until stop, which can grow without bound on busy pages. → Testing ReviewStatus: ✅ Completed The PR adds substantial async dispatch and Playwright routing behavior, but I don’t see tests covering the new execution paths or the browser-driver precedence rules.
|
- Normalize legacy wait aliases after browser-driver routing selects Playwright - Parse legacy wait and wait disable rows in Playwright wait handling - Cover Playwright versus Selenium routing and legacy timeout/state parsing
- It did not match the Selenium counterpart behaviour - Selenium's double click action actually does a mouse movement for execution
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed The async migration introduced two blocking regressions in the performance-action path: newly async handlers are still called synchronously, and the handlers themselves still use → Security ReviewStatus: ✅ Completed No critical security regressions stood out in the async Playwright/Selenium parity changes. I found one data-exposure concern in the new network logging path. → Performance ReviewStatus: ✅ Completed I found one performance issue in the new Playwright network logging path: it retains request objects unnecessarily during capture, which can grow memory usage without affecting the final output. → Testing ReviewStatus: ✅ Completed The PR’s async browser-session routing changes are largely untested; the highest-risk gap is a missing regression test that proves
|
Summary
MainDriverintegration.Playwright Async Migration
MainDriverintegration to async execution.go to linkaction to async and reset iframe context during navigation.Browser Session Interoperability
go to linkand other commonly used actions.driver_idinstead of assuming the default session.Playwright Feature Coverage And Parity
Get_Elementbehavior more closely."action"column parsing behavior between frameworks.browser driveras an optional parameter andBROWSER_DRIVERas a runtime parameter.Reliability Fixes
validate partial textwas not being resolved correctly.Browser Provisioning And Installation
Performance And Maintenance
PILpost-processing for Playwright screenshots.uv.lock.Tests
tests/test_browser_sessions.py.tests/test_playwright_actions_parity.py.tests/test_playwright_locator.py.Files With Significant Changes
Framework/Built_In_Automation/Web/Playwright/BuiltInFunctions.pyFramework/Built_In_Automation/Web/Playwright/locator.pyFramework/Built_In_Automation/Web/Selenium/BuiltInFunctions.pyFramework/Built_In_Automation/Web/utils.pyFramework/Built_In_Automation/Web/Playwright/utils.pyFramework/Built_In_Automation/Sequential_Actions/sequential_actions.pyFramework/Built_In_Automation/Sequential_Actions/common_functions.pyFramework/MainDriverApi.py