Class: Selenium::DevTools::V131::Audits

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v131/audits.rb

Constant Summary collapse

EVENTS =
{
  issue_added: 'issueAdded',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Audits

Returns a new instance of Audits.



29
30
31
# File 'lib/selenium/devtools/v131/audits.rb', line 29

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#check_contrast(report_aaa: nil) ⇒ Object



54
55
56
57
# File 'lib/selenium/devtools/v131/audits.rb', line 54

def check_contrast(report_aaa: nil)
  @devtools.send_cmd('Audits.checkContrast',
                     reportAAA: report_aaa)
end

#check_forms_issuesObject



59
60
61
# File 'lib/selenium/devtools/v131/audits.rb', line 59

def check_forms_issues
  @devtools.send_cmd('Audits.checkFormsIssues')
end

#disableObject



46
47
48
# File 'lib/selenium/devtools/v131/audits.rb', line 46

def disable
  @devtools.send_cmd('Audits.disable')
end

#enableObject



50
51
52
# File 'lib/selenium/devtools/v131/audits.rb', line 50

def enable
  @devtools.send_cmd('Audits.enable')
end

#get_encoded_response(request_id:, encoding:, quality: nil, size_only: nil) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/selenium/devtools/v131/audits.rb', line 38

def get_encoded_response(request_id:, encoding:, quality: nil, size_only: nil)
  @devtools.send_cmd('Audits.getEncodedResponse',
                     requestId: request_id,
                     encoding: encoding,
                     quality: quality,
                     sizeOnly: size_only)
end

#on(event, &block) ⇒ Object



33
34
35
36
# File 'lib/selenium/devtools/v131/audits.rb', line 33

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["Audits.#{event}"] << block
end