I have a bat file that is running my JUnit Cucumber tests. This bat file is being invoked by TeamCity. Once the JUnit Cucumber tests have been run, the output more or less ends with:
[15:24:37]18 Scenarios (18 passed)
[15:24:37]187 Steps (187 passed)
[15:24:37]0m24.339s
How can I save the line "18 Scenarios (18 passed)" to a variable in TeamCity, so that the next build step in TeamCity, which is an email test results component, can use this variable to send an email that contains the content of this variable? Otherwise the test results file that it attaches just has the details of each scenario without an overall summary being visible to the recipient.
mvn test
. Teamcity automatically parse your junit.xml results and can build Test tab with test counts, test names, etc. and if any tests will be failed then teamcity failed the build. or, you can just pass junit-results.xml for teamcity – Senior Pomidor