citrus icon indicating copy to clipboard operation
citrus copied to clipboard

loading directory with .xml test files

Open codinglightly opened this issue 2 years ago • 3 comments

User story As a tester, I want to be able load all xml tests from a directory, so no java code modification is needed when adding additional tests.

Additional context I was trying something like

@CitrusTestSource(type=TestLoader.XML, packageScan="file:mytestdir" ....

with little success. I would like to see such a functionality built in (or best practice in documentation/samples to achieve this)

codinglightly avatar Sep 24 '23 21:09 codinglightly

packageScan is only for resources in classpath so it will not work with file: file system resources. The sources property in the @CitrusTestSource annotation should be able to support file system resources. But at the moment this is not loading files from a directory but only supports a list of fully qualified file paths.

I think what you are trying to do is not possible at the moment and would be an enhancement for the sources property in the @CitrusTestSource annotation to load all files from a given directory.

christophd avatar Sep 25 '23 09:09 christophd

cc: @tschlat would be worth contributing our code for this, if possible.

@codinglightly we "own" this functionality, company-internal. let's see if we can free it from code specific to our needs and contribute it for the world.

bbortt avatar Sep 25 '23 09:09 bbortt

@bbortt , that would be great. And it could make citrus more usable to people, who are not java native :-)

codinglightly avatar Oct 04 '23 20:10 codinglightly