Hi Olga,
The use case I have is a little different from what you stated.
End of Functional test run -> Only TestRunListener.afterRun should be invoked -> This works
End of Security test Run -> Only SecurityTestRunListener.afterRun should be invoked. -> BothTestRunListener.afterRun and SecurityTestRunListener.afterRun are getting invoked.
I added the target ^((?!Security).)*$ to the TestRunListener.afterRun and ran the Security test named SecurityTest 10
Here are the logs at the end of a Security test. It runs the TestRunListener also.
- Wed Aug 21 14:14:08 MDT 2019: INFO: #######Normal Test Run Listener script#######
- Wed Aug 21 14:14:08 MDT 2019: INFO: Test case name : GETVersion200 Test Suite Name : Version
- Wed Aug 21 14:14:08 MDT 2019: INFO: Time Taken: 6079 Run Status : PASS Status: Passed
- Wed Aug 21 14:14:10 MDT 2019: INFO: #######Security Test Run Listener script#######
- Wed Aug 21 14:14:10 MDT 2019: INFO: Name : GETVersion200
- Wed Aug 21 14:14:10 MDT 2019: INFO: Test case name : GETVersion200 Test Suite Name : Version
- Wed Aug 21 14:14:10 MDT 2019: INFO: Time Taken: 6079 Run Status : PASS Status: Passed