samedi 2 janvier 2016

when use spock in android, raise "Test running failed: No test results Empty test suite."

I use this repo, create android test with "Run > Debug ...> select AndroidTest", the test code is:

class MainActivitySpec extends Specification {

    @UseActivity(MainActivity)
    def activity

    def "test activity setup"() {
        expect:
        activity != null
        activity instanceof MainActivity
    }

    def "test layout"() {
        given:
        def button = activity.findViewById(R.id.main_button) as Button

        when:
        def buttonText = button.getText()

        then:
        buttonText == "Test"
    }
}

I get output:

Test running startedTest running failed: No test results

Empty test suite.

Aucun commentaire:

Enregistrer un commentaire