kumars12
8 years agoOccasional Contributor
Mongo Context varibale - Is it possible to use it throughout the test suite
Greetings, While working with MondoDB using gmongo (groovy wrapper), we open connection using mongoDB context, something like this: def mongoClient = new MongoClient( new ServerAddress(dbServer), A...
- 8 years ago
You can set context variables in Project or TestSuite setup scripts which will then be accessible by anything under it. While I have not used this for database connections, I have stored other variables this way.
A word of warning! If for example a test case relies on something defined in a project setup script, you will always have to run from the project level. I ran into problems of not just being able to run a single test case. Now I always try to make my test cases self contained.