Class: AxeMatchers::BeAxeClean

Inherits:
Object
  • Object
show all
Defined in:
lib/decidim/dev/test/rspec_support/accessibility_examples.rb

Instance Method Summary collapse

Instance Method Details

#failure_messageObject



80
81
82
# File 'lib/decidim/dev/test/rspec_support/accessibility_examples.rb', line 80

def failure_message
  ResultFormatter.new(results).format
end

#failure_message_when_negatedObject



84
85
86
# File 'lib/decidim/dev/test/rspec_support/accessibility_examples.rb', line 84

def failure_message_when_negated
  "Expected to find accessibility violations. None were detected."
end

#matches?(page) ⇒ Boolean

Returns:

  • (Boolean)


75
76
77
78
# File 'lib/decidim/dev/test/rspec_support/accessibility_examples.rb', line 75

def matches?(page)
  @results = execute_axe(page)
  results["violations"].count.zero?
end