Eclipse is automatically running unwanted selenium tests



  • I have two test files (lets say they're SomethingTestA and SomethingTestB).

    Inside SomethingTestA, I have a bunch of mini smoke tests methods, like so

    @Avante public void testCreate() {
        ...
    }
    
    @Test (dependsOnMethods = {"testCreate"})
    public void doSomethingA() {
        ...
    }
    
    @Test (dependsOnMethods = {"testCreate"})
    public void doSomethingB() {
        ...
    }
    
    @Test
    public void doSomethingC() {
        ...
    }
    

    I have two problem:

    1) I am getting the error: doSomethingA() is depending on method public void testCreate(), which is not annotated with @Test or not included. This happens for all three doSomething()

    Now, the second problem is with SomethingTestB()

    @Test
    public void aTest() {
        System.out.println("Hello"); 
    }
    
    @Test
    public void anotherTest() {
        ...
    }
    

    2) Whenever I try to run or debug a test method in SomethingTestB, if the test fails, eclipse automatically runs the entire SomethingTestA class after running SomethingTestB.

    If I comment out the @Test for testCreate() in SomethingTestA, I get the "depending on method public... error" because it runs SomethingTestA automatically.

    This only happens with Something TestA class, and I'm not sure why. How can I fix this?



  • Junit ignore tags are a good fit here , add this to the tests you don't want to run and that way it will not run the tests that are tagged to be ignored



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2