Reputation: 31
I want to have testcases on seperate files that can be imported into the suites files. Is there any way to do this in robot or any other python automation frameworks.
Upvotes: 1
Views: 108
Reputation: 386362
You can't import a test case into a test suite file, but you can certainly put one test case in a test suite file, and place many such files in a folder. That folder can then be treated like a test suite without having to import anything.
Given the following file structure:
my_test_suite/
|-- test1.robot
|-- test2.robot
`-- test3.robot
You can run my_test_suite
directly from robot:
$ robot my_test_suite
If you want to add some metadata such as a suite setup, create a file named __init__.robot
inside of my_test_suite
. In there you can put a *** Settings ***
table just like you can in normal test suite files.
Upvotes: 2