"No tests found for given includes" for TestNG + Gradle + @Test(dependsOnMethods)
<p>I have following dummy test class</p>

<pre><code>package my.test;

import org.testng.annotations.*;

public class NgScenario {

    public static void trace(String msg) {
        System.err.println(msg);
    }

    @BeforeClass
    public void init() {
        trace("-- NgScenario");
    }

    @AfterClass
    public void shutdown() {
        trace("-- NgScenario");
    }

    @Test(dependsOnMethods = {"step2"})
    public void step1() throws Exception {
        trace("-- step1");
    }

    @Test
    public void step2() throws Exception {
        trace("-- step2");
    }

    @Test(dependsOnMethods = {"step2"})
    public void step3() throws Exception {
        trace("-- step3");
    }
}
</code></pre>

<p>and <code>build.gradle</code></p>

<pre><code>apply plugin: 'java'

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
}

dependencies {
    compile "org.testng:testng:6.9.10"
}

test {
    useTestNG()
    scanForTestClasses = false  
    include '**/*'

    beforeTest { descriptor -&gt;
        logger.lifecycle("Gradle running test: ${descriptor}")
    }
}
</code></pre>

<p>When I execute simple command <code>gradle test</code> - everything is OK and output is following (note: <code>step2</code> intentionally depends on <code>step1</code> to check that order is indeed correct):</p>

<pre><code>Gradle running test: Test method step2(my.test.NgScenario)
Gradle running test: Test method step1(my.test.NgScenario)
Gradle running test: Test method step3(my.test.NgScenario)
</code></pre>

<p>Now, assuming I have 100 methods in scenario and I want to test-debug in my IDE only single branch of methods - I run command <code>gradle test --tests my.test.NgScenario.step1</code> and receive this error</p>

<pre><code>No tests found for given includes: [my.test.NgScenario.step1]
</code></pre>

<p><code>step1</code> has <code>dependsOnMethods</code> in its annotation. Same command for test <em>without</em> <code>dependsOnMethods</code> runs OK: <code>gradle test --tests my.test.NgScenario.step2</code>.</p>

<p>So the question is - <strong>what I'm doing/expecting wrong?</strong></p>

<p>I'd like to both use test scenarios and be able to start individual test sub-tree in IDE. </p>

<p>On top of this - it would be nice to be able execute 'step1' without tasks it depends on (assuming 'parent' steps are 'clean+setup' - they are not needed for debugging of single test with all pre-requisites already in-place). </p>

<p>As off-topic - another framework which is able to integrate into gradle build can be recommended.</p>