After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 583976 - dogtail test suite for evince print settings
dogtail test suite for evince print settings
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: printing
git master
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-27 09:57 UTC by Bartek Kostrzewa
Modified: 2009-05-30 20:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dogtail test suite to test print settings combinations (4.84 KB, text/plain)
2009-05-27 09:58 UTC, Bartek Kostrzewa
Details
a 3-page pdf with large page numbers, for testing odd-paged documents (8.03 KB, application/pdf)
2009-05-27 09:59 UTC, Bartek Kostrzewa
Details
4-page document with large page numbers, for testing even-paged documents (8.58 KB, application/pdf)
2009-05-27 10:01 UTC, Bartek Kostrzewa
Details
dogtail test suite to test print settings combinations - v2 (5.97 KB, text/plain)
2009-05-27 12:28 UTC, Bartek Kostrzewa
Details
dogtail test suite to test print settings combinations - v3 (5.98 KB, text/plain)
2009-05-27 12:36 UTC, Bartek Kostrzewa
Details
dogtail test suite to test print settings combinations - v4 (6.06 KB, text/plain)
2009-05-27 13:48 UTC, Bartek Kostrzewa
Details
dogtail test suite to test print settings combinations - v5 (7.49 KB, text/plain)
2009-05-27 16:21 UTC, Bartek Kostrzewa
Details
dogtail test suite to test print settings combinations - v6 (6.25 KB, text/plain)
2009-05-27 22:37 UTC, Bartek Kostrzewa
Details

Description Bartek Kostrzewa 2009-05-27 09:57:41 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)
Comment 1 Bartek Kostrzewa 2009-05-27 09:58:32 UTC
Created attachment 135424 [details]
dogtail test suite to test print settings combinations

The actual python script.
Comment 2 Bartek Kostrzewa 2009-05-27 09:59:40 UTC
Created attachment 135425 [details]
a 3-page pdf with large page numbers, for testing odd-paged documents
Comment 3 Bartek Kostrzewa 2009-05-27 10:01:34 UTC
Created attachment 135426 [details]
4-page document with large page numbers, for testing even-paged documents
Comment 4 Bartek Kostrzewa 2009-05-27 10:14:53 UTC
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)
Comment 5 Bartek Kostrzewa 2009-05-27 12:28:48 UTC
Created attachment 135432 [details]
dogtail test suite to test print settings combinations - v2
Comment 6 Bartek Kostrzewa 2009-05-27 12:36:55 UTC
Created attachment 135433 [details]
dogtail test suite to test print settings combinations - v3

Sorry, there was a typo in there.
Comment 7 Bartek Kostrzewa 2009-05-27 13:48:31 UTC
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!
Comment 8 Bartek Kostrzewa 2009-05-27 13:55:25 UTC
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 :)
Comment 9 Bartek Kostrzewa 2009-05-27 16:21:52 UTC
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.
Comment 10 Bartek Kostrzewa 2009-05-27 22:37:07 UTC
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.
Comment 11 Nickolay V. Shmyrev 2009-05-30 20:12:22 UTC
Amazing, thanks a lot Bartek! I've added the files to the test folder, I hope this test will be useful in the future.