Re: dogtail test suite test harness

2007-07-25 Thread Josh Sled
Derek Atkins [EMAIL PROTECTED] writes:
 PS: I realize it might be easier now to have all your classes in
 a single Gnucash.py, but eventually I think it might be better
 to separate the various classes into separate files, like Register.py,
 AccountTree.py, NewAccountDialog.py, PriceDialog.py, etc.  But this
 doesn't have to happen right away.

Ah, Derek, one thing about this I forgot when we talked on irc ...
In python, files correspond to modules; there's no ability to group
multiple files into the same module/namespace/package.  Thus, the file
NewAccountDialog.py, e.g.:

class NewAccountDialog (Dialog):
# ...

...is a NewAccountDialog module containing the NewAccountDialog class.  It's
referenced both other files as:

import NewAccountDialog
foo = NewAccountDialog.NewAccountDialog()

If each class corresponds to a file corresponds to a module, it can be very
verbose.

There is a different form of the import statement, like:

# from $module import $name
from NewAccountDialog import NewAccountDialog
foo = NewAccountDialog()

But it's frowned upon.  There's also:

import NewAccountDialog as NAD
foo = NAD.NewAccountDialog()

But it not really great either.


A different approach is to separate the classes into related groups such as
dialogs.py or register.py.  Then the fully-qualified names are more
manageable:

   import dialogs, register
   new_account = dialogs.NewAccountDialog()
   basic = register.BasicViewRegister()
   # ...

We stay pythonic, but the code gets factored a bit better.

Hopefully this is a good middle-ground.

-- 
...jsled
http://asynchronous.org/ - a=jsled; b=asynchronous.org; echo [EMAIL PROTECTED]


pgpjuJMHWU0KT.pgp
Description: PGP signature
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: dogtail test suite test harness

2007-07-25 Thread Derek Atkins
ahmad sayed [EMAIL PROTECTED] writes:

 Sorry for the delay, I was out of home for 3 days:).

No worries.  we all have our delays.  :)

 (As Derek asked:) are these window x,y coordinates, or logical widget
 locations?

 Based on the command above I'd ASSUME it's logical widget locations..
 ?? But I'm wondering how it deals with invisible widgets.
 yes it is logical,

Okay, so you have a path down the widget tree and say something
like 1 - 3 - 2 - 1 - 5 - 3 to walk the list of widgets?
Or is it really an x-y coordinate?

 yes i could not deal with invisible widget, but please could you give me a
 solid example for this invisible widget, I use a mix of mouse coordinate and

this invisible widget?  Which one?  There are a number of times when
for example a widget is hidden in order to change the way a dialog
looks based on the dynamic state of the context.  For example, the
Transfer dialog hides certain widgets based on whether it's instantiated
as a full transfer or as an exchange-rate dialog.  In another example,
the Search window changes the button names based on whether it's
a Select or Find.

I'm afraid I dont know enough about the register to point you to 
the register hidden widget(s).

 keyboard hot-keys, you could look at the code on the dogtail branch
 in GnuCash.py (Class Register), I will add more comments to make it more
 clear.

My python fu is low, so I could look at it but I doubt I'll really
understand all of it.

 dogtail could expand a tree from other application, i tried it with at-spi
 browser (an application  bundeled with  dogtail),  but with gnucash i could
 only collapse the treetable?!!, i am going to find out other options, I'm also
 going to dogtail mailing list to find out what does this mean.

Okay, so how is our tree different than their tree?

 Derek said:
 I'd suggest that instead of this you work on all the other dialogs and
 try to get as much coverage as you can without spending too much time
 purely on the register.

 I'm with Derek, I expect more issues while writing more testcases.

Right, and that's fine and good.  I'd rather see more coverage for
the rest of the application because the register is being worked on
now, so once the rewrite finishes all your existing test cases will
need to get rewritten to the new register interface.

-derek

PS: I realize it might be easier now to have all your classes in
a single Gnucash.py, but eventually I think it might be better
to separate the various classes into separate files, like Register.py,
AccountTree.py, NewAccountDialog.py, PriceDialog.py, etc.  But this
doesn't have to happen right away.

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: dogtail test suite test harness

2007-07-24 Thread Josh Sled
ahmad sayed [EMAIL PROTECTED] writes:
 Josh Said:
 you suggested some approach like Junit,  I tried pyunit and it looks nice to 
 me,  do you have any issues regarding using it to organize our test cases.
 It looks like you've started down that path.  Whatever you're comfortable
 using is good, but things that are established and will time (like python's
 `unittest` module) are always good to leverage.

 (good to leverag) sorry I didn't get the meaning of this expression, i hope 
 it means that you agree with me on using pyunit :).

Yes. :)

-- 
...jsled
http://asynchronous.org/ - a=jsled; b=asynchronous.org; echo [EMAIL PROTECTED]


pgpmBY9gjMkbW.pgp
Description: PGP signature
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: dogtail test suite test harness

2007-07-23 Thread ahmad sayed
Sorry for the delay, I was out of home for 3 days:).

 (As Derek asked:) are these window x,y coordinates, or logical widget 
 locations?

 Based on the command above I'd ASSUME it's logical widget locations..
?? But I'm wondering how it deals with invisible widgets.
yes it is logical,
yes i could not deal with invisible widget, but please could you give me a 
solid example for this invisible widget, I use a mix of mouse coordinate and 
keyboard hot-keys, you could look at the code on the dogtail branch 
in GnuCash.py (Class Register), I will add more comments to make it more clear.

 2 - I got a problem with expanding the tree in the account pages so i only 
 could create an account like
 Expenses:Taxs
 only parent and child more account like Expense:Taxs:Insurance currently no 
 luck with them

 Where does the problem lie?  With dogtail, I imagine...?  It seems somewhat
 important that we're able to test files as generated with our Common
 Accounts account-template.

dogtail could expand a tree from other application, i tried it with at-spi 
browser (an application  bundeled with  dogtail),  but with gnucash i could 
only collapse the treetable?!!, i am going to find out other options, I'm also 
going to dogtail mailing list to find out what does this mean.

Derek said:
 I'd suggest that instead of this you work on all the other dialogs and
 try to get as much coverage as you can without spending too much time
 purely on the register.

I'm with Derek, I expect more issues while writing more testcases.


Josh Said:
 you suggested some approach like Junit,  I tried pyunit and it
looks nice to me,  do you have any issues regarding using it to
organize our test cases.
 It looks like you've started down that path.  Whatever you're comfortable
 using is good, but things that are established and will time (like python's
 `unittest` module) are always good to leverage.

(good to leverag) sorry I didn't get the meaning of this expression, i hope it 
means that you agree with me on using pyunit :).


Best Regards,
Ahmed Sayed





   

Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: dogtail test suite test harness

2007-07-20 Thread Derek Atkins
Josh Sled [EMAIL PROTECTED] writes:

 the bad news is:
 1 - In order to be  able to access some components, I use some raw inputs,  
 according to dogtail  the raw input is to do mouse click using the 
 coordinate, 
 Like
 rawClick(wiget.position[0], widget.position[1])

 (As Derek asked:) are these window x,y coordinates, or logical widget
 locations?

Based on the command above I'd ASSUME it's logical widget locations..
But I'm wondering how it deals with invisible widgets.

 Feel free to completely ignore this, but maybe it makes sense for you to look
 at the 'register-rewrite' branch, and see if you can contribute at least a
 basic dogtail-based test using that register.  It should be far easier, and
 hopefully we'll move to that codeline in the (near) future.

I'd suggest that instead of this you work on all the other dialogs and
try to get as much coverage as you can without spending too much time
purely on the register.

-derek

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: dogtail test suite test harness

2007-07-19 Thread Josh Sled
ahmad sayed [EMAIL PROTECTED] writes:
 2 - I'm able to test the register and i compelete a smplified version of 
 tutorial 1  and 2.

This is great. :)

 the bad news is:
 1 - In order to be  able to access some components, I use some raw inputs,  
 according to dogtail  the raw input is to do mouse click using the 
 coordinate, 
 Like
 rawClick(wiget.position[0], widget.position[1])

(As Derek asked:) are these window x,y coordinates, or logical widget
locations?

 2 - I got a problem with expanding the tree in the account pages so i only 
 could create an account like
 Expenses:Taxs
 only parent and child more account like Expense:Taxs:Insurance currently no 
 luck with them

Where does the problem lie?  With dogtail, I imagine...?  It seems somewhat
important that we're able to test files as generated with our Common
Accounts account-template.

 BTW: i tried to play with gnucash register code, and atk but i make a very 
 slight progress, like making dogtail read the  register as table but it will 
 require a lot of time the register code is
 too big.

Yeah. :(

Feel free to completely ignore this, but maybe it makes sense for you to look
at the 'register-rewrite' branch, and see if you can contribute at least a
basic dogtail-based test using that register.  It should be far easier, and
hopefully we'll move to that codeline in the (near) future.

 you suggested some approach like Junit,  I tried pyunit and it looks nice to 
 me,  do you have any issues regarding using it to organize our test cases.

It looks like you've started down that path.  Whatever you're comfortable
using is good, but things that are established and will time (like python's
`unittest` module) are always good to leverage.

-- 
...jsled
http://asynchronous.org/ - a=jsled; b=asynchronous.org; echo [EMAIL PROTECTED]


pgpQIaySiouMB.pgp
Description: PGP signature
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: dogtail test suite test harness

2007-07-08 Thread ahmad sayed
Derek,

Sorry, I found that gnucash devel is very busy those days so I expect that it 
will be better to send this issue in private Email. 

Best regards,
Ahmed Sayed




 

Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: dogtail test suite test harness

2007-07-08 Thread Derek Atkins
Ahmad,

Quoting ahmad sayed [EMAIL PROTECTED]:

 Derek,

 Sorry, I found that gnucash devel is very busy those days so I expect 
 that it will be better to send this issue in private Email.

Private email *IS* the best way to send this..  However IRC is another
route, and if you don't get a response to something like this within
a day then you should definitely try to contact me via an alternate
route.  My spam filter can be a little over-zealous.

 Best regards,
 Ahmed Sayed

-derek

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


dogtail test suite test harness

2007-07-07 Thread ahmad sayed
Hi Josh,

Sorry for my long silence i got some issues with my PC lately, I solved it at 
last,

currently i have a mix of good news and bad news.
the good news is:

1 - Currently we have wrapper to most of dialogs, our wrapper module reach more 
than 1000 LOC.
2 - I'm able to test the register and i compelete a smplified version of 
tutorial 1  and 2.

the bad news is:
1 - In order to be  able to access some components, I use some raw inputs,  
according to dogtail  the raw input is to do mouse click using the coordinate,  
Like 
rawClick(wiget.position[0], widget.position[1])

2 - I got a problem with expanding the tree in the account pages so i only 
could create an account like
Expenses:Taxs
only parent and child more account like Expense:Taxs:Insurance currently no 
luck with them

also to access the register I use some tricks and work around Like 

===
def set_cell_text(self, text):
relative_pos = self.column_val - self.prev_col_val
print relative_pos
if relative_pos  0 :
for i in range(relative_pos):
self.keyCombo(Tab)
else:
for i in range(abs(relative_pos)):
self.keyCombo(ShiftISO_Left_Tab)

self.typeText(text)


in this code i save my previos position in if it is after my current position 
press tab for n times else press shit-tab for n times, something like this.

ofcourse i was expecting more from dogtail unlike other Testing tool, i used or 
read about but the register needs some work to make it play nice with 
dogtail(make it accessible), 

BTW: i tried to play with gnucash register code, and atk but i make a very 
slight progress, like making dogtail read the  register as table but it will 
require a lot of time the register code is too big.

3 - i have a problem with my svn account I contacted Derek to help me solving 
it.

The news ends here, :)

Back to testplan running:
you suggested some approach like Junit,  I tried pyunit and it looks nice to 
me,  do you have any issues regarding using it to organize our test cases.

Best regards,
Ahmed Sayed




  

Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel 
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: dogtail test suite test harness

2007-07-07 Thread Derek Atkins
Ahmad,

It's a good thing you said something here.  Your private email landed
in my spam folder so I would never have seen it!

More in-line...

Quoting ahmad sayed [EMAIL PROTECTED]:

 Hi Josh,

 Sorry for my long silence i got some issues with my PC lately, I 
 solved it at last,

 currently i have a mix of good news and bad news.
 the good news is:

 1 - Currently we have wrapper to most of dialogs, our wrapper module 
 reach more than 1000 LOC.
 2 - I'm able to test the register and i compelete a smplified version 
 of tutorial 1  and 2.

This is very good news...

 the bad news is:
 1 - In order to be  able to access some components, I use some raw 
 inputs,  according to dogtail  the raw input is to do mouse click 
 using the coordinate,
 Like
 rawClick(wiget.position[0], widget.position[1])

Hmm...  Is the position based on pixels or based on other widget packing?

 2 - I got a problem with expanding the tree in the account pages so i 
 only could create an account like
 Expenses:Taxs
 only parent and child more account like Expense:Taxs:Insurance 
 currently no luck with them

I think that a two-level hierarchy MIGHT be enough to test everything.
Honestly it might be better if we could have a three-level hierarchy,
but I think we can live with two for now.

 also to access the register I use some tricks and work around Like

 ===
def set_cell_text(self, text):
relative_pos = self.column_val - self.prev_col_val
print relative_pos
if relative_pos  0 :
for i in range(relative_pos):
self.keyCombo(Tab)
else:
for i in range(abs(relative_pos)):
self.keyCombo(ShiftISO_Left_Tab)

self.typeText(text)
 

 in this code i save my previos position in if it is after my current 
 position press tab for n times else press shit-tab for n times, 
 something like this.

That's perfectly reasonable.  Note that you should also test the
arrow keys and 'enter' as input methods.

 ofcourse i was expecting more from dogtail unlike other Testing tool, 
 i used or read about but the register needs some work to make it play 
 nice with dogtail(make it accessible),

Is there some other Unix/Gnome testing tool that you'd prefer?
I dont think any of us are whetted to Dogtail specifically.

 BTW: i tried to play with gnucash register code, and atk but i make a 
 very slight progress, like making dogtail read the  register as table 
 but it will require a lot of time the register code is too big.

Honestly I wouldn't waste too much time trying to hack the register.

 3 - i have a problem with my svn account I contacted Derek to help me 
 solving it.

As I said, thanks for mentioning that here as I didn't see the original
message.  In the future if you don't hear back from me within 24 hours
you should try contacting me on IRC (or better yet, try IRC first!)

 The news ends here, :)

 Back to testplan running:
 you suggested some approach like Junit,  I tried pyunit and it looks 
 nice to me,  do you have any issues regarding using it to organize 
 our test cases.

I dont, but keep in mind that right now we don't have different sets
of test cases, there is only make check which runs EVERY test,
and users can manually run specific tests by running make check TESTS=...
where ... is the list of tests to run.

In the end I'd sort of like to see the dogtail tests made a part of make
check so that the self-test runs all the GUI tests too.  So much of our
code is GUI code that really make check doesn't test enough of our code.
Just my opinion.

 Best regards,
 Ahmed Sayed

-derek

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel