Newbie here. I’m hoping someone can give me an outline of how to
re-use rspec scripts by passing them parameters.
The situation I have is testing a web application (using watir) for
about 30 different customers. Some of the customers have unique
features in their particular application instance, but much of the
codebase is shared (about 90%). So what I need to be able to do is
write rspec tests covering that shared codebase. But I need to in
some way pass in the customer name so that watir can log into the
right application instance.
Any help with this is greatly appreciated. I still have much to learn
about Rspec, but so far this seemingly simple task has me stumped.
some way pass in the customer name so that watir can log into the
–
My mother used to say to me, “In this world, Elwood, you must be oh so
smart or oh so pleasant.” Well, for years I was smart. I recommend
pleasant. You may quote me.
Thanks for the response. That’s an interesting approach. I will try
that and see how far I can get with it.
If my ruby chops were a little better, I suspect I could find a more
elegant solution. Any other ideas out there?
It sounds like you want a configuration file of some kind. In Java,
I’d suggest starting with a properties file. Could you externalize the
per-customer differences to any kind of configuration file (yaml would
be the standard, no?)? Then you could build a rake task to supply the
right configuration file for each customer, or even iterate over them.