Question

I was using Pydev on Eclipse. I understand if I have a Eclipse folder with 5 files containing unit-tests, I can run these tests once by right-clicking on the name of the folder in Eclipse, choosing "Run-As" --> "Python unit-test". This works fine for me.

What would be the recommended way to run these tests for the fixed number of times? For example, if I wanted to run the 5 tests in the folder 10 times each?

I would be very grateful if you could help me out.

Thanks!

Was it helpful?

Solution

I think that the problem is in the way you are constructing your tests. There are a two problems I see:

  1. If tests are failing because of poor image recognition, then surely they indicate either a bug in Sikuli, or a badly designed test. Unit tests should be predictable and repeatable, so requiring that they run several times indicates that they are not well set up.

  2. If you really do need to run the UI tests mutliple times, then this should be done in the code, not in the IDE, since you can't guarantee that they will always be run in that environment (e.g. what if you want to move to CI?). So you need something like this in your code:

    def test_ui_component(self): for i in range(1): # Test code here

    You could probably abstract the pattern out using a decorator or class inheritance if you really want to.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top