RobotFramework tags + 罗列testcase

1. Tags

功能强大,个性化跑测试用例

robot -i smoke -e nrun ./

 

2. 罗列testcase

from robot.running import TestSuiteBuilder
from robot.model import SuiteVisitor


class TestCasesFinder(SuiteVisitor):
    def __init__(self):
        self.tests = []

    def visit_test(self, test):
        # print(dir(test))
        if(len(test.tags)) != 0:
            print(test.tags)
            print(test.longname)
            print(test.name)

        self.tests.append(test)

builder = TestSuiteBuilder()
testsuite = builder.build('./')
finder = TestCasesFinder()
testsuite.visit(finder)

print(*finder.tests)
print(len(finder.tests))

 

上一篇:Introduction of IoT(2): RFID


下一篇:git push提示dst refspec XXX matches more than one