GNOME Bugzilla – Bug 583976
dogtail test suite for evince print settings
Last modified: 2009-05-30 20:12:22 UTC
This is a surprisingly short dogtail test script to iterate through all the different print settings (for print to file). It arose out of the discussion for bug 583429. It comes with 2 pdfs which have large numbers on them, so that they can be checked by eye easily for correct page placement. It currently outputs straight to the home directory (because I was lazy, to be honest) [or the last directory used when printing to file, I suppose] The print dialog needs to be set up beforehand to some defaults (see the source comments at the top) and the script needs to be run in the folder where the two pdfs reside. The combinations of options to be tested can be modified easily by changing the list definitions at the top. (I recommend commenting the original line and writing a new one)
Created attachment 135424 [details] dogtail test suite to test print settings combinations The actual python script.
Created attachment 135425 [details] a 3-page pdf with large page numbers, for testing odd-paged documents
Created attachment 135426 [details] 4-page document with large page numbers, for testing even-paged documents
There's a typo in one line, "reysult" should be "result". I will correct it with the next update of the script. (I might reduce some of the delays between clicks and so on, to speed things up)
Created attachment 135432 [details] dogtail test suite to test print settings combinations - v2
Created attachment 135433 [details] dogtail test suite to test print settings combinations - v3 Sorry, there was a typo in there.
Created attachment 135438 [details] dogtail test suite to test print settings combinations - v4 Hopefully this is the last one for today, sorry for the attachment spam! The spinbutton has to be "activated" after its value has been set, otherwise the value is not used!
I think this mostly works now, except for the caveats in the comments... it would be great to fix those but I don't know how. AFAIK the guys working on Maemo use PyUnit to assert the state of UI elements in conjunction with dogtail. Here's a screencast of the thing working in VirtualBox: http://www.youtube.com/watch?v=4YZjHSMgOYI Also note: there is a conditional "delete" statement in there aimed at the generated filenames in your HOME DIRECTORY, so you might want to run it in a VM or at least under a test user account! Just to make sure... interpreters can be dangerous :)
Created attachment 135448 [details] dogtail test suite to test print settings combinations - v5 After running through 250 iterations I noticed that pythonean 'logic' is very different from what we're used to. Also, I had messed up the toggling of the checkboxes by being dumb. There's some debug statements in here, control structures for the checkbox states and some very explicit checks regarding collate / reverse.
Created attachment 135469 [details] dogtail test suite to test print settings combinations - v6 no need for the silly global control variables, I've found out how to inquire about the state of checkboxes. Also, the delete statement is now much safer.
Amazing, thanks a lot Bartek! I've added the files to the test folder, I hope this test will be useful in the future.