Class: Capybara::Playwright::Driver
  
  
  
  
  
    - Inherits:
 
    - 
      Driver::Base
      
        
          - Object
 
          
            - Driver::Base
 
          
            - Capybara::Playwright::Driver
 
          
        
        show all
      
     
  
  
  
  
  
      - Extended by:
 
      - Forwardable
 
  
  
  
  
  
      - Includes:
 
      - DriverExtension
 
  
  
  
  
  
  
    - Defined in:
 
    - lib/capybara/playwright/driver.rb
 
  
  
 
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  
  #on_save_raw_screenshot_before_reset, #on_save_screenrecord, #on_save_trace, #start_tracing, #stop_tracing, #trace, #with_playwright_page
  
  Constructor Details
  
    
  
  
    #initialize(app, **options)  ⇒ Driver 
  
  
  
  
    
Returns a new instance of Driver.
   
 
  
  
    
      
9
10
11
12
13
14
15
16
17
18
19
20
21 
     | 
    
      # File 'lib/capybara/playwright/driver.rb', line 9
def initialize(app, **options)
  @browser_runner = BrowserRunner.new(options)
  @page_options = PageOptions.new(options)
  if options[:timeout].is_a?(Numeric)     @default_navigation_timeout = options[:timeout] * 1000
  end
  if options[:default_timeout].is_a?(Numeric)
    @default_timeout = options[:default_timeout] * 1000
  end
  if options[:default_navigation_timeout].is_a?(Numeric)
    @default_navigation_timeout = options[:default_navigation_timeout] * 1000
  end
end
     | 
  
 
  
 
  
    Instance Method Details
    
      
  
  
    #invalid_element_errors  ⇒ Object 
  
  
  
 
    
      
  
  
    #needs_server?  ⇒ Boolean 
  
  
  
  
    
      
24 
     | 
    
      # File 'lib/capybara/playwright/driver.rb', line 24
def needs_server?; true; end 
     | 
  
 
    
      
  
  
    #no_such_window_error  ⇒ Object 
  
  
  
 
    
      
  
  
    #reset!  ⇒ Object 
  
  
  
  
    
      
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83 
     | 
    
      # File 'lib/capybara/playwright/driver.rb', line 61
def reset!
    if callback_on_save_screenshot?
    raw_screenshot = @browser&.raw_screenshot
    if raw_screenshot
      callback_on_save_screenshot(raw_screenshot)
    end
  end
      video_path = @browser&.video_path
      @browser&.clear_browser_contexts
  if video_path
    callback_on_save_screenrecord(video_path)
  end
  @browser = nil
end
     | 
  
 
    
      
  
  
    #wait?  ⇒ Boolean 
  
  
  
  
    
      
23 
     | 
    
      # File 'lib/capybara/playwright/driver.rb', line 23
def wait?; true; end 
     |