mercredi 29 juin 2016

Appium TestNG Running Isolated Test vs. Fixture

I'm not sure how I should organize my test classes in TestNG for Appium. I currently have a @Factory that instantiates an instance for each locally attached devices (with parallel="instances").

Normally, when I run a test case, I want that test case to be self-contained. In the context of Appium, this doesn't make sense to me. I figured that I could essentially use a class to create a common state, and then use dependsOnMethods and dependsOnGroups to control execution of all methods that follow setup.

I know that I can use listeners to retry a test case and repeat the setup in case that a test fails for something that isn't an Assert. This approach makes sense to me in that it would save a lot of time (restarting the app is quite a bit of overhead), while also allowing you to isolate tests in the case that one of the dependencies messes up.

I figured that this approach would make creating tests cases more difficult, but that could probably be solved by making this approach optional (vs. the default of running isolated tests).

Are there other down-sides for taking this approach? Also, if having dependent test methods is discouraged, what is the TestNG dependsOnMethods normally used for?

Aucun commentaire:

Enregistrer un commentaire