Snooz82 / robotframework-datadriver

Library to provide Data-Driven testing with CSV tables to Robot Framework
Apache License 2.0
131 stars 37 forks source link

DataDriver Run in Python with tags (include) #86

Closed Krata4 closed 1 year ago

Krata4 commented 1 year ago

Hello, I would like ask you regarding run tests with datadriver via Python run. Tags are not accepted and all test run. Example: 1) Command line robot --outputdir Results -i test Tests/Webchat.robot = WORKING 2) Python - option_dic = { "outputdir": f'Results', "include":"test"} run(f'Tests/Webchat.robot', option_dic) = NOT WORKING 3) Python - run(f'Tests/', option_dic, variable=variables, suite=suite,include=["test"]) - NOT WOKRING

NOT WORKING mens: In Python file I am not able to run tests with tags. Still all tests are triggered.

Krata4 commented 1 year ago

Hello,

any progress in this issue please?

Thanks Jirka

Krata4 commented 1 year ago

Hello,

please, any progress?

Thanks

Snooz82 commented 1 year ago

Proposal is to additionally read the OPTIONS robot variables. At the moment DataDriver does use the sys.argv and let it analyse by robots argument parser. Therefore it is not possible for DataDriver to get includes that are not part of the sys.argv.

&{OPTIONS}': {'include': [], 'exclude': ['EXCL'], 'skip': ['SKIP'], 'skip_on_failure': []}

Snooz82 commented 1 year ago

that OPTIONS variable would require RF 5.0

Krata4 commented 1 year ago

Hello,

but your proposal is my option 2:

option_dic = { "outputdir": f'Results', "include":"test"} run(f'Tests/Webchat.robot', option_dic) = NOT WORKING

am I right? This is not working

Snooz82 commented 1 year ago

I think that option should not work in general. Afaik you have to unpack the option_dict with **option_dict or as single named args.

but anyway. If version 2 works, then 1, 2 and 3 would work with my proposal.