I’m wondering if you can use wildcard characters with tags to get all tagged scenarios/features that match a certain pattern.
For example, I’ve used 17 unique tags on many scenarios throughout many of my feature files. The pattern is “@jira=CIS-” followed by 4 numbers, like @jira=CIS-1234 and @jira=CIS-5678.
I’m hoping I can use a wildcard character or something that will find all of the matches for me.
I want to be able to exclude them from being run, when I run all of my features/scenarios.
I’ve tried the follow:
–tags ~@jira
–tags ~@jira*
–tags ~@jira=*
–tags ~@jira=
Unfortunately none have given my the results I wanted. I was only able to exclude them when I used the exact tag, ex. ~@jira=CIS-1234. It’s not a good solution to have to add each single one (of the 17 different tags) to the command line. These tags can change frequently, with new ones being added and old ones being removed, plus it would make for one real long command.
Yes. First read this – there is this un-documented expression-language (based on JS) for advanced tag selction based on the @key=val1,val2
form: /a/67219165/143475
So you should be able to do this:
valuesFor('@jira').isPresent
And even (here s
will be a string, on which you can even do JS regex if you know how):
valuesFor('@jira').isEach(s => s.startsWith('CIS-'))
Would be great to get your confirmation and then this thread itself can help others and we can add it to the docs at some point.
10