Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

@Test
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?

share|improve this question
    
You may need to include the entire class in your xml as described here: groups.google.com/forum/#!topic/testng-users/ciy1C9Bt9FY – Sam Woods Jun 30 '14 at 17:40
    
I wish I could help you here, but I can't. If you could describe more about how you actually run your tests in eclipse (there are several ways) it might be easier. Also, three of your four tags are not relevant for your specific problem. I'm guessing that a JUnit tag would fit better. – KjetilNordin Jul 8 '15 at 14:19

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.