dimanche 10 mai 2015

SWTBot - is it possible to repeate TestCases?

I've created 2 test cases, I want to re-run both tests by changing some parameters on the test classes..

so, I've created a Class with name 'AllTestCases' and ran a loop to rerun the test cases. The problem here is that when I run the 'AllTestCases' class I see the 4 tests under the main suite, but when test starts to run SWTBot repeate the same tests that already run!

here is where I did the loop:

public static Test suite() throws Exception {
    bot = new SWTWorkbenchBot();
    TestSuite suite = new TestSuite();

    for(Iterator<String> i = myAvailableBoards.iterator(); i.hasNext(); ) {         
        String item = i.next();
        IP_ADDRESS = item;          
        suite.addTest(new JUnit4TestAdapter(Test1_RunTest.class));
        suite.addTest(new JUnit4TestAdapter(Test1_DebugTest.class));
    }

    return suite;
}

and here is a screenshot after run: http://ift.tt/1EsJXLU

I think that happen because under the suite I run the same Class name, and SWTBot doesn't see the difference and ran the same class name!

My question is there any solution to change the class name (the Test Case Name) ? or any other solution...

Aucun commentaire:

Enregistrer un commentaire