Extending subsequent tests with dogtail tests?

Samuel Thibault sthibault at hypra.fr
Wed Feb 20 17:07:58 UTC 2019


Hello,

Libreoffice currently uses unit tests to check precise functions, and
junit tests to check the behavior at the programmatic interface.

For accessibility testing, we would like to introduce tests to check the
behavior at the user interface itself, by using dogtail (developped by
Fedora, based on at-spi) to simulate keypresses, mouse clicks, and check
the results.

The idea is that at Hypra, we have a well-established documentation
of what keyboard shortcut sequences blind users would employ to use
libreoffice, and which we should thus make sure always work. The key
sequences might have to be changed if that's for a good reason, but at
least we would know about it and update the documentation accordingly.

I have put a prototype of what we are thinking of on 
https://git.hypra.fr/hypra/regression-testing/tree/master

An example of what it would look like is:

  press('F6')
  menu = app.child('File', 'menu')
  waitFocus(menu)
  
  press('F6')
  new = app.child('New', 'push button')
  waitFocus(new)
  
  press('F6')
  style = app.child('Paragraph Style', 'text')
  waitFocus(style)

etc.

which here allows to check that the F6 shortcut properly gets the menu,
the toolbar, the style, to be focused, etc. 

I have written a "log" script that can generate such testcase code:
a user can run libreoffice and perform a usage scenario, and "log"
will get the interesting events from at-spi (keypresses, focus change,
checkbox status change, etc.) and emit the python code which simulates
keypresses and waits for the results. That way we can easily produce
testcases from our documentation, by just running the use cases
described in it, which are representative of what a blind user needs to
be able to do.

Dogtail depends on atspi, but also on python-cairo, python-gi,
gir1.2-gtk-3.0.  I don't think we really want to add them to external/
just for testing?  Just like, AIUI, junit tests don't run if you don't
have java already available?  So we would just run the tests along junit
tests, on a system which is known to have the required dependencies,
right?  We (Hypra) could then feed libreoffice with such tests, from
our documentation.  We can probably produce dozens of them, which can
probably be tested within something like a few minutes.

Samuel


More information about the LibreOffice mailing list