Open dagansandler opened 6 years ago
IInvokedMethodListener should only be invoked for the first config method as it is the only method being invoked by TestNG
Why is the config method is called? I expect no config method at all.
I can send the revised tests as a PR but without a fix for now... let me know if I should anyway.
It's always a good start :)
Opening this new issue after correspondence in #1870
I can send the revised tests as a PR but without a fix for now... let me know if I should anyway.
TestNG Version
Description
In TestNG's own tests, in the test class
test.listeners.ordering.ListenerInvocationListenerInvocationDisabledBehaviorTest
which validates listener calls and their order, one of the test method has an inaccurate expected result.That method is
testOrderHasOnlyFailedAndSkippedConfigAndSkippedTestMethod
in which the executed test class contains 1 failed config method, which leads to skipping another config method and a test method. This issue appears when using thealwaysrunlisteners
set to false, which is not the default behavior. I also suggest that this becomes the default behavior forIInvokedMethodListener
in 7.0.0Expected behavior
IInvokedMethodListener should only be invoked for the first config method as it is the only method being invoked by TestNG
Actual behavior
IInvokedMethodListener is invoked for both config methods, but not for the test method. This is both unexpected and inconsistent.
Is the issue reproductible on runner?
Test case sample
Here is the revised test method with the correct listener calls:
Please also see the following test class which uses the same test classes and scenarios to validate calls to the
IInvokedMethodListener
on its own: package test.listeners;