Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors and extra tests reported at Zebrunner reporting when attempting to disable entire test class via @Test(enabled = false) #2273

Open
obabich-solvd opened this issue Mar 21, 2024 · 0 comments
Labels
Milestone

Comments

@obabich-solvd
Copy link

When using the @Test(enabled = false) annotation to disable an entire test class, unnecessary methods such as quitDriver, quitDrivers, removeCapabilities, setCapabilities, clearCases appear at Zebrunner reporting.

Carina-core-version: 1.2.7
Zebrunner-agent-version: 1.9.8

Additional context
I use custom implementation for getDriver() and a single session is started for whole test class.

Logs/Links
Getting such errors for mistakenly created tests at Zebrunner :

  • test clearCases

java.lang.NullPointerException
at org.testng.internal.BaseTestMethod.getRetryAnalyzerConsideringMethodParameters(BaseTestMethod.java:813)
at org.testng.internal.BaseTestMethod.getRetryAnalyzer(BaseTestMethod.java:681)
at org.testng.internal.invokers.TestInvoker.shouldRetryTestMethod(TestInvoker.java:549)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:726)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.testng.TestRunner.privateRun(TestRunner.java:848)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:481)
at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

  • test setCases

org.testng.TestNGException:
Cannot inject @Test annotated Method [setCases] with [class [Ljava.lang.String;].
For more information on native dependency injection please refer to https://testng.org/doc/documentation-main.html#native-dependency-injection
at org.testng.internal.Parameters.checkParameterTypes(Parameters.java:436)
at org.testng.internal.Parameters.createParametersForMethod(Parameters.java:350)
at org.testng.internal.Parameters.createParameters(Parameters.java:693)
at org.testng.internal.Parameters.handleParameters(Parameters.java:879)
at org.testng.internal.Parameters.handleParameters(Parameters.java:728)
at org.testng.internal.invokers.ParameterHandler.handleParameters(ParameterHandler.java:72)
at org.testng.internal.invokers.ParameterHandler.createParameters(ParameterHandler.java:51)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:911)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.testng.TestRunner.privateRun(TestRunner.java:848)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:481)
at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

  • test quitDriver

java.lang.NullPointerException
at org.testng.internal.BaseTestMethod.getRetryAnalyzerConsideringMethodParameters(BaseTestMethod.java:813)
at org.testng.internal.BaseTestMethod.getRetryAnalyzer(BaseTestMethod.java:681)
at org.testng.internal.invokers.TestInvoker.shouldRetryTestMethod(TestInvoker.java:549)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:726)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.testng.TestRunner.privateRun(TestRunner.java:848)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:481)
at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

  • tets quitDrivers

org.testng.TestNGException:
Cannot inject @Test annotated Method [quitDrivers] with [class [Lcom.zebrunner.carina.webdriver.TestPhase$Phase;].
For more information on native dependency injection please refer to https://testng.org/doc/documentation-main.html#native-dependency-injection
at org.testng.internal.Parameters.checkParameterTypes(Parameters.java:436)
at org.testng.internal.Parameters.createParametersForMethod(Parameters.java:350)
at org.testng.internal.Parameters.createParameters(Parameters.java:693)
at org.testng.internal.Parameters.handleParameters(Parameters.java:879)
at org.testng.internal.Parameters.handleParameters(Parameters.java:728)
at org.testng.internal.invokers.ParameterHandler.handleParameters(ParameterHandler.java:72)
at org.testng.internal.invokers.ParameterHandler.createParameters(ParameterHandler.java:51)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:911)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.testng.TestRunner.privateRun(TestRunner.java:848)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:481)
at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

  • test setCapabilities

org.testng.TestNGException:
Cannot inject @Test annotated Method [setCapabilities] with [class org.openqa.selenium.MutableCapabilities].
For more information on native dependency injection please refer to https://testng.org/doc/documentation-main.html#native-dependency-injection
at org.testng.internal.Parameters.checkParameterTypes(Parameters.java:436)
at org.testng.internal.Parameters.createParametersForMethod(Parameters.java:350)
at org.testng.internal.Parameters.createParameters(Parameters.java:693)
at org.testng.internal.Parameters.handleParameters(Parameters.java:879)
at org.testng.internal.Parameters.handleParameters(Parameters.java:728)
at org.testng.internal.invokers.ParameterHandler.handleParameters(ParameterHandler.java:72)
at org.testng.internal.invokers.ParameterHandler.createParameters(ParameterHandler.java:51)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:911)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.testng.TestRunner.privateRun(TestRunner.java:848)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:481)
at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

  • test removeCapabilities

java.lang.NullPointerException
at org.testng.internal.BaseTestMethod.getRetryAnalyzerConsideringMethodParameters(BaseTestMethod.java:813)
at org.testng.internal.BaseTestMethod.getRetryAnalyzer(BaseTestMethod.java:681)
at org.testng.internal.invokers.TestInvoker.shouldRetryTestMethod(TestInvoker.java:549)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:726)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.testng.TestRunner.privateRun(TestRunner.java:848)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:481)
at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

@akamarouski akamarouski added this to the 1.3.10 milestone Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants