How s3cur3/phoenix_test_playwright works
Main Components Identification
a) Phoenix Test Integration Layer
• This at the top level as it's the main entry point
• Represented by PhoenixTest.Case
b) Playwright Integration Layer
• Core component handling browser automation
• Contains multiple sub-components from the lib/phoenix_test/playwright/ directory
c) Browser Communication Layer
• Handles the actual communication with browsers
• Includes Port and Connection management
Component Relationships
[Phoenix Application Under Test] ←→ [PhoenixTest Layer]
• ↑ ↓
• ↑ [Playwright Layer]
• ↑ ↓
• ← [Browser Interface Layer]
• ↓
• [Actual Browser Instance]
Detailed Component Breakdown
For the Playwright Layer, show these key components:
• Browser Management (browser.ex)
• Context Management (browser_context.ex)
• Frame Handling (frame.ex)
• Selector Logic (selector.ex)
• Message Processing (message.ex)
• Serialization (serialization.ex)
Communication Flow
• Command flow from Phoenix Test → Playwright
• Response flow from Browser → Phoenix Test
• Port communication between Elixir and Playwright
Important Elements
a) Core Components:
[PhoenixTest.Case] → [Playwright] → [Browser]
b) Integration Points:
• Port Communication
• Message Serialization
• Browser Context Management
c) Test Support Infrastructure:
• Endpoint
• Router
• Controllers/LiveViews
Technical Details to Note
Specific technical aspects:
• Port-based communication system
• Browser context isolation
• Selector strategy implementation
• Message serialization/deserialization
Architectural Patterns to Highlight
• Command pattern for browser interactions
• Bridge pattern between Elixir and Playwright
• Factory pattern for browser/context creation
Remember to include:
• Version compatibility information
• Configuration points
• Test execution flow
• Error handling paths