INFO暂时找不到测试类SampleTest

时间:2019-06-10 08:57:00

标签: android python-3.x sl4a

我正在将SL4A与ACTS(Android Comms测试套件)一起使用,以运行一些简单的测试用例。但我得到错误

INFO Cannot find test class SampleTest skipping for now.

这是我的配置类,即Sample.json

    {   "_description": "This is an example skeleton test configuration file.",
    "testbed":
    [
        {
            "_description": "Sample testbed with no devices",
            "name": "SampleTestBed"
        }
    ],
    "logpath": "/tmp/logs",
    "testpaths": ["../tests/sample"],
    "custom_param1": {"favorite_food": "Icecream!"}
}

这是我的课程,即SampleTest.py

from acts.base_test import BaseTestClass


class SampleTest(BaseTestClass):

    def __init__(self, controllers):
        BaseTestClass.__init__(self, controllers)
        self.tests = (
            "test_make_toast",
        )

        """Tests"""

    def test_make_toast(self):
        for ad in self.android_devices:
            ad.droid.makeToast("Hello World...")
            return True

这就是我运行ACT的方式,如下所示

act.py -c Sample.json -tb SampleTestBed -tc SampleTest:test_make_toast

但是我遇到了以上错误。有帮助吗?

1 个答案:

答案 0 :(得分:0)

这是一个简单的问题。我在配置文件中添加了标签“ AndroidDevice”:“ *”。问题就解决了。

 {   "_description": "This is an example skeleton test configuration file.",
    "testbed":
    [
        {
            "_description": "Sample testbed with no devices",
            "name": "SampleTestBed"
           "AndroidDevice": "*"

        }
    ],
    "logpath": "/tmp/logs",
    "testpaths": ["../tests/sample"],
    "custom_param1": {"favorite_food": "Icecream!"}
}