This is to announce that RAAKT (The Ruby Accessibility Analysis Kit) has been updated. This release includes more accessibility tests and an initial mapping of tests to the Unified Web Evaluation Methodology (UWEM). Also, thanks to Derek Perrault RAAKT now uses Hpricot to parse the HTML document. This solves the problem where the previous parser (RubyfulSoup) declared a class “Tag” that was likely to clash with your local classes in Rails.

To install the new version simply type gem update raakt or gem install raakt if you have a previous version installed.

Changelog

Summary of changes from version 0.4 to version 0.5.1.

  • Example of how to use RAAKT in Watir unit tests.
  • Tests for area element alt attribute.
  • UWEM mapped in comments for relevant test methods.
  • Test to check that input fields of type image have an alt attribute with text.
  • Refactoring of some methods for more compact syntax. Patch by Derek Perrault.
  • Added test to verify that fieldsets have legends.
  • Fixed alt_to_text that needed to check element type before attempting to read attribute value.
  • Fixed language attribute check (downcased value). Added iso language code list.
  • Applied patch from Derek Perrault (better use of Hpricot features).
  • Fixed check for lang attribute (now requires a value as well).
  • Test for charset mismatch in http headers and document meta element.
  • Switch to Hpricot. Patch by Derek Perrault.

An article on the value of, and how to integrate basic accessibility tests in your development process is in the works for standards-schmandards.com. In the meantime check out the Raakt wiki.

If you are using Watir it is very simple:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
require 'watir' require 'raakt' require 'test/unit'

class TC_myTest < Test::Unit::TestCase attr_accessor :ie

  def setup 
    @ie = Watir::IE.start("http://www.peterkrantz.com") 
  end

  def test_startPagePassesBasicAccessibilityCheck #set up the accessibility test and pass html to raakt 
    raakttest = Raakt::Test.new(@ie.document.body.parentelement.outerhtml)

    #run all tests on the current page 
    result = raakttest.all

    #make sure raakt didn't return any error messages 
    assert(result.length == 0, result) 
  end 
end