[Pkg-privacy-maintainers] GUI tests for MAT
Sascha Steinbiss
satta at tetrinetsucht.de
Thu Mar 17 07:24:48 UTC 2016
Hi intrigeri,
[…]
>> I'm not merging this branch as-is into master since I have a few
>> questions, and at least one hard-coded sleep time made me slightly
>> uncomfortable.
>
> Yes, I see what you mean. My solution was mostly a trade-off between time and beauty, but since these tests do not have deadlines it couldn’t hurt giving them a second look.
I have now found the time to revisit these points and address them in the code.
>> So, while reading the code, I took some notes about
>> bits I was not sure about. Here they are in the form of "XXX" comments
>> inline:
>>
>> --- a/debian/tests/check-mat
>> +++ b/debian/tests/check-mat
>> @@ -52,6 +52,7 @@ class TestMatGUIFunctional(unittest.TestCase):
>> self.add = self.rootapp.child(roleName="tool bar").child(name="Add")
>> self.clean = self.rootapp.child(
>> roleName="tool bar").child(name="Clean")
>> + # XXX: Why do we have to do this by hand?
>
> Maybe we don’t but I had at least one case where window focus was lost and the test hung.
Removed the explicit focus statements now. I have re-run the test suite 20 times in a row now and never noticed a problem so it might have been an artefact of me monitoring the run in an Xvfb-attached VNC session.
>> self.rootapp.child(name="Quit", roleName="menu item").click()
>>
>> def test_start_no_warnings(self):
>> @@ -117,6 +120,7 @@ class TestMatGUIFunctional(unittest.TestCase):
>> window.child("mat").click()
>> window.child(self.tmpdir).click()
>> window.child("OK").click()
>> + # XXX: can't we explicitly wait for the $something we need to wait for?
>
> Yes I guess we can and it is safer of course. Let me see what I can do. I guess one can check whether the list of loaded files to clean contains the expected number of items.
I have now replaced the sleep calls here with explicit waiting for the status bar to return to ‘Ready’ after triggering an long running action such as loading or cleaning files. This also proved to work well in the tests without relying on arbitrary waiting times and should make the code more robust.
I hope these changes (pushed to git) address your concerns.
Cheers
Sascha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.alioth.debian.org/pipermail/pkg-privacy-maintainers/attachments/20160317/171efd0f/attachment.sig>
More information about the Pkg-privacy-maintainers
mailing list