Does Robot Framework support tagging tests with AND logic?
Currently we can tag a test like [tags] tag1 tag2 in which tag1 and tag2 are logical ORs. Can we tag the test plan so that it only matches runs (in my case, DUTs) that include both tag1 AND tag2?
The problem I’m facing is that I have multiple network devices I need to run tests against. I have some tests that can only run on some of these devices, and not others.
For example, I have three DUTs with the following “tags”.
DUT1:
- RoleA
- Type1
DUT2:
- RoleB
- Type2
DUT3:
- RoleA
- Type3
I will be running a robot command that target’s each of these DUTs and passes in the role and type parameters as tags. Essentially saying “this is the DUT to target and here is what it supports”.
I have a test that matches this criteria (RoleA OR Role B) AND (Type1 OR Type2). Given this, we should expect the test to run on DUT1 and DUT 2, but not DUT3.
how can I define the tags in the test plans to make this work? If I use the --include flag and AND on the tags, then that run will ignore tests that are just tagged with RoleA, which isn’t desirable.