How can I run tests with name value tags?

Viewed 65

I saw your answer for this question which gave me hope:

Using tags to exclude group of features

We have a practice of tagging tests that fail due to defect so we can run them in a failed group and have the tests that are supposed to pass in another group. This allows us to quickly review a regression run to find new failures, not the failures that are pushed off for the next sprint.

We tag our scenarios like this where the value is the defect id:

@FAIL=DE12345
Scenario: API Scenario

Our Junit Test runner was updated based on the feedback on the other post to run all tags that contain the name in the tag: https://github.com/intuit/karate/blob/89179842ff7260b1bc299f96d0dda9ddf6afcd2e/karate-core/src/test/java/com/intuit/karate/core/TagsTest.java#L59

Results results = Runner.path("classpath:com/company/tests")
                .tags("valuesFor('@FAIL').isPresent")
                .parallel(5);

Nothing runs when I do this. It looked like it was what I was hoping for but I think I may be doing something wrong. I tried this in 0.9.6 and 1.1.0.

1 Answers

Yes, the few questions where people report not being able to get it to work has been frustrating. I've asked every one to follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue - but no luck.

Maybe you will be the one to "break the chain". If we can get a clear way to replicate, we can fix it. So please consider contributing some time to make the framework better.

Related