Custom Actions using helper functions/keywords

0 views
Skip to first unread message

Felipe Knorr Kuhn

unread,
Jul 21, 2009, 5:53:56 PM7/21/09
to pycc...@googlegroups.com
Hello all,

Since Custom Actions are so powerful, I was wondering how hard it would be to implement something like "partial custom actions" or even custom actions that make use of the Python libraries.

For example, in a system I am working on, I would need to write a test that goes like this:

Given that
  The "users" database is empty <this would make some SQL query>

or

Given that
  The database is restored <this would drop all tables and populate them again>
When
  I fill the "from" textbox with the current date <defining or not a date format>
  And I fill the "to" textbox with tomorrow date

...

I know you guys will probably say that the acceptance tests should not include dynamic data and that I should prepare the test environment before running the tests (through a CI server or whatnot), but I believe that dynamic data/keywords make the tests closer to the user and preparing the test bed through Pyccuracy is a nice way to show how powerful it is :)


Regards,
FK

Gabriel Falcão

unread,
Jul 21, 2009, 6:08:01 PM7/21/09
to pycc...@googlegroups.com
The answer is quite simple: "That is not hard at all".

The method execute of the Pyccuracy Action can perform any python
logic you need/want.
If you want, I can write some examples.
--
:wq

Atenciosamente
__________________________________________
Gabriel Falcão

Jabber: gabrie...@jabber-br.org
Blog: http://www.nacaolivre.org

Felipe Knorr Kuhn

unread,
Jul 21, 2009, 6:34:47 PM7/21/09
to pycc...@googlegroups.com
Hello Gabriel,

I would really appreciate that :)

Any plans to update the custom action examples as well?

Mine are working but Pyccuracy was complaining that the execute method needed 3 args (self, context and kwargs), but I only needed "self" and "context".

Thanks!

Regards,
FK

2009/7/21 Gabriel Falcão <gabriel...@gmail.com>

Henrique Bastos

unread,
Jul 23, 2009, 4:42:15 PM7/23/09
to pycc...@googlegroups.com
Actually, it would be nice to use fixtures to prepare complex scenarios. 

However, I yet don't know if we _should_ have this kind of problem using Pyccuracy. Can't say if this is a design/code smell or something.

[]'s,
--
Henrique Bastos
+55 21 9618-6180
Reply all
Reply to author
Forward
0 new messages