diff --git a/test/resources/SkipTests.py b/test/resources/SkipTests.py new file mode 100644 index 0000000000..97355ec3b4 --- /dev/null +++ b/test/resources/SkipTests.py @@ -0,0 +1,25 @@ +"""Pre-run modifier that skips tests by their name. +Tests to skip are specified by Test Name +""" + +import os +from robot.api import SuiteVisitor + + +class SkipTests(SuiteVisitor): + + def __init__(self, list_skip_test): + self.list_skip_test = list_skip_test + + if self.list_skip_test: + print("List of tests to be skipped:") + print(f" - {self.list_skip_test.replace(',', f'{os.linesep} - ')}") + else: + print("No tests to be skipped") + + def visit_test(self, test): + """Set tag to skip tests""" + + # set `robot:skip` tag + if test.name in self.list_skip_test.split(","): + test.tags.add("robot:skip") diff --git a/test/run.sh b/test/run.sh index 5a9e7dfa59..570171366c 100755 --- a/test/run.sh +++ b/test/run.sh @@ -15,7 +15,7 @@ OUTDIR="${ROOTDIR}/_output/e2e-$(date +%Y%m%d-%H%M%S)" function usage { local -r script_name=$(basename "$0") cat - <