Class: Axe::Core
- Inherits:
-
Object
- Object
- Axe::Core
- Defined in:
- lib/axe/core.rb
Constant Summary collapse
- JS_NAME =
"axe"
Class Method Summary collapse
Instance Method Summary collapse
- #call(callable) ⇒ Object
- #call_verbatim(callable) ⇒ Object
-
#initialize(page) ⇒ Core
constructor
A new instance of Core.
Constructor Details
#initialize(page) ⇒ Core
Returns a new instance of Core.
11 12 13 14 |
# File 'lib/axe/core.rb', line 11 def initialize(page) @page = wrap_driver page load_axe_core Axe::Configuration.instance.jslib end |
Class Method Details
.has_run_partial?(page) ⇒ Boolean
28 29 30 31 32 |
# File 'lib/axe/core.rb', line 28 def self.has_run_partial?(page) page.evaluate_script <<-JS typeof window.axe.runPartial === 'function' JS end |
Instance Method Details
#call(callable) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/axe/core.rb', line 16 def call(callable) if use_run_partial callable.analyze_post_43x @page, self else callable.call @page end end |
#call_verbatim(callable) ⇒ Object
24 25 26 |
# File 'lib/axe/core.rb', line 24 def call_verbatim(callable) callable.call @page end |