简体   繁体   中英

Robot Framework : How to maintain (sub) test suite directories in different paths

we are using GitHub and the RF test cases are spread across different GitHub projects.

There is a central project which contains the robot framework wrapper. This central project is required for all the other testcases to run.

(We are going to all this trouble mainly to avoid too many people sending commits and pull requests to the same central repository )

So effectively the master directory of the RF test suite is kept separately from the sub suite directories.

The questions is ,is there a best way or recommended way of adding or combining different test directories at the time of running the tests?

Or in other words how to keep the (sub) test suite directories in different paths (Not a common ancestor directory) and still use them together when we need to run the tests

I think it sounds like a weird requirement but we have it now

Robot makes this pretty easy. If you give it more than one file or folder on the command line it will join them into a virtual suite for the purposes of reporting. So, the short answer is to check out the repsitories wherever you want, and then reference them when you run the tests. See the section Specifying test data to be executed in the robotframework users guide.

You can go a step further and use an argument file , which lets you collect the paths to all of your suites in one place. Not only that, but you can give this suite a name, and also add documentation.

For example, create a file named fullsuite.args with these contents:

--name Full Test Suite
--doc Combination of all suites from all git repositories
/path/to/suite1
/path/to/another/suite.robot
/another/path/to/another/suite.txt

You can then run it using the --argumentfile option:

$ pybot --argumentfile fullsuite.args

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM