These Aegis automated accessibility tests were developed with the help of Aegis project funding. They are built upon the Mago 1.0 test infrastructure and can use validator plugins compatible with the Accerciser accessibility API exploration tool. The tests can be checked out of the bazaar repository here: https://code.launchpad.net/a11ytesting These are designed to test a software component's usage of ATk/ATSPI and are generic enough that they have been used on GNOME 2.30 in Oracle Solaris 11 and Oracle Enterprise Linux (OEL) as well as GNOME 3.2.x on top of a build-and-test tinderbox on the OpenSuSE based GNOME accessibility testing distro.
Open Accessibility Infrastructure Testing framework
AEGIS AUTOMATED ACCESSIBILITY TESTS
Event Monitor Support The A11yGenericApplicationTestSuite class contains some event monitor methods which allow an accessibility test to be invoked when a specific event occurs. These event monitor support methods are: register_event_listener(self, function, event_name) Register a method which will be invoked when event_name event occurs . monitor_events(self) Start the registry in a different thread from the event monitor. Test PRIMITIVES These test primitives are the building blocks of test scenarios. They allow procedural as well as event triggered invocation of individual accessibility tests. traverse_menu(menu) Use keyboard navigation to traverse the items in a menu. traverse_menubar(window_name, menubar, startmenuname='') Traverse an application's menu bar by using the tab and down arrow keys assert that each enabled menu and item is reachable source code traverse_main_menu(window_name, app_name, startmenuname='') Use keyboard navigation to traverse the main menu of an application traverse_child_menubars(window_name, acc, startmenuname='') Use keyboard navigation to traverse the child menubars of an application check_acc_keybinding(acc) Invoke the advertised keyboard shortcuts for an accessible. traverse_focusable_children(window_name, acc) Attempts to use keyboard navigation (tab and arrow) to traverse the focusable children of an accessible traverse_focusable_buttons(window_name, acc) Attempts to use keyboard navigation (tab) to traverse the focusable buttons which are children of an accessible The following test primitives are inherited from Accerciser using the accerciser validator plugins and the AEGIS testing framework plugin adapter: ActionIsInteractive Any item that supports the action interface should also be focusable or selectable so the user may interact with it via the keyboard. WidgetHasAction Any widget with a role listed in condition should support the action interface. OneFocus The application should have on and only one accessible with state focused at any one time. WidgetHasText Any widget with a role listed in condition should support the text interface since they all support stylized text. ParentChildIndexMatch The index returned by acc.getIndexInParent should return acc when provided to getChildAtIndex. ReciprocalRelations Any relation in the map should point to an accessible having the reciprocal relation. HasLabelName Any accessible with one of the roles listed below should have an accessible name, a labelled by relationship, or both. TableHasSelection A focusable accessible with a table interface should also support the selection interface. StateWithAbility Any accessible with one of the ephemeral states in state map should have the corresponding -able state. RadioInSet An accessible with a radio button role should be a member of a set as indicated by a relation or appropriate object property. TableRowColIndex The index returned by getIndexAt(row, col) should result in getRowAtIndex and getColumnAtIndex returning the original row and col. TableRowColParentIndex The accessible returned by table.getAccessibleAt should return acc.getIndexInParent matching acc.getIndexAt. ImageHasName Any accessible with an image role or image interface should have either a name, description, or image description. Annex I - Source code download section The AEGIS testing framework development branch can be checked out as follows:
HOWTO run automated accessibility tests
bzr branch lp:a11ytesting cd a11ytesting mago -a a11y -f gedit.xml --log-level=debug Test results will appear under the ~/.mago/a11y directory.
Annex II - SAMPLE TEST DEFINITIONS
AEGIS Accessibility framework tests are in the form of mago XML files. Here are some examples:
I. Listen for "window:activate" events and run a set of accerciser validator tests on the resulting window: <?xml version="1.0"?> <suite name="a11y generic application"> <classpath>a11y</classpath> <class>a11yGenericTestSuite.A11yAccerciserTestSuite</class> <description> Registers test functions which will be invoked when certain events occur </description> <case name="Register Listener"> <method>register_accerciser_validators</method> <description>Register accerciser validators</description> <args> <event_name>window:activate</event_name> <use_validators>ImageHasName,ParentChildIndexMatch,RadioInSet,ReciprocalRelations,StateWithAbility,HasLabelName,TableHasSelection,TableRowColIndex,TableRowColParentIndex,WidgetHasAction,WidgetHasText</use_validators> </args> </case> </suite> II. Traverse the main menu of the gnome-panel application: <?xml version="1.0"?> <suite name="a11y generic application"> <class>a11yGenericTestSuite.A11yGenericApplicationTestSuite </class> <description> Tests generic accessibility functionality. </description> <case name="Generic Accessibility Tests"> <method>traverse_main_menu</method> <description>Test menubar navigation by arrow.</description> <args> <window_name>* - panel*</window_name> <app_name>gnome-panel</app_name> <startitem>Applications</startitem> </args> </case> </suite> III Launch calculator and traverse all focusables using keyboard navigation: <?xml version="1.0"?> <suite name="a11y generic application"> <class>a11yGenericTestSuite.A11yGenericApplicationTestSuite </class> <description> Tests calculator's generic accessibility functionality. </description> <case name="Launch Calculator"> <method>launch_app</method> <description>Launch gnome calculator</description> <args> <window_name>frmCalculator*</window_name> <app_name>gcalctool</app_name> </args> </case> <case name = "Traverse Applicaiton Focusables"> <method>traverse_app_focusables</method> <args> <window_name>frmCalculator*</window_name> <app_name>gcalctool</app_name> </args> </case> <case name = "Traverse Calculator Main Menu"> <method>traverse_main_menu</method> <args> <window_name>frmCalculator*</window_name> <app_name>gcalctool</app_name> <startitem>Calculator</startitem> </args> </case> </suite>
Annex III – Additional UTILITY FUNCTIONS
def delay(nsecs): def get_method(myobject, method_name): def call_method(myobject, method_name): def startup(application): def get_desktop(num): def get_wins_with_state(state): def get_apps(desktop): def find_app(app_name,desktop_num=0): def find_accessible(parent_acc,accessible_name,role=""): def focus_accessible(acc): def get_apps_with_focus(desktop): def get_focused_on_desktop(desktop): def get_focusable_children(acc): def get_focused_children(acc): def get_text_areas(acc): def get_buttons(acc): def get_active_buttons(acc): def get_focused_button(acc): def get_focused_buttons(acc): def get_active_focusables(acc): def get_panels(acc): def get_active_panels(acc): def get_menubars(acc): def get_menus(acc): def get_menu_items(acc): def get_active_menus(acc): def get_active_menu_items(acc): def get_frames(acc): def activate_window(windowname): def activate_menu(windowname,menuname): def page_up(): def page_down(): def next_focusable_by_rt_arrow(): def next_focusable_by_tab(): def prev_focusable_by_lt_arrow(): def prev_focusable_by_up_arrow(): def next_focusable_by_down_arrow(): def prev_focusable_by_sh_tab(): def get_acc_keybinding(acc): def click(self,app_name,object_name):