Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] allow multiple groups with AND condition #3125

Open
SiKing opened this issue May 8, 2024 · 2 comments
Open

[Feature Request] allow multiple groups with AND condition #3125

SiKing opened this issue May 8, 2024 · 2 comments

Comments

@SiKing
Copy link

SiKing commented May 8, 2024

Currently when running tests with multiple groups, we can use syntax something like mvn test -Dgroups="groupA,groupB". This will run any tests that are tagged with "groupA" OR "groupB".

Please create an option to combine multiple groups with the AND condition. So if I specify something like mvn test -Dgroups="group1+group2", this will run any tests that are tagged with "group1" AND "group2".

There is additional discussion in the testng-users forum, here.

@itkhanz
Copy link

itkhanz commented May 16, 2024

I think this is already possible, I am aware of includeGroups and excludeGroups from testng xml file:
https://testng.org/#_exclusion_groups

You can also take a look at beanshell expressions to define advanced AND OR conditions to include and exclude groups based on your conditions if you have a TESTNG XML file
https://testng.org/#_beanshell_and_advanced_group_selection

@SiKing
Copy link
Author

SiKing commented May 16, 2024

Additional information: For my use case, my entire test suite has something like two-dozen different groups. At run time (in CI) I have no way of knowing what are all the groups that have been created. Adding all these as "exclude groups" is not feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants