qmetry/qaf-cucumber

Null pointer issue with Cucumber 6.8.1, TestNG 7.1.0, QAF 3.0.0

aruna3390 opened this issue · 1 comments

QAF Version - 3.0.0 & QAF-CUCUMBER 3.0.0

Note: only the latest version is supported

Steps To Reproduce

1. Create a gherkin feature 
2. Use Cucumber 6.8.1 , TestNG 7.1.0 and QAF 3.0.0
3. Create Runner class extends AbstractTestNGCucumberTests

Runner Class:
import io.cucumber.testng.AbstractTestNGCucumberTests;
import io.cucumber.testng.CucumberOptions;

@CucumberOptions(features = "src/test/resources/features",
glue = {"steps","stepDefinition" },
tags = ("@test1"),
plugin = {
"pretty",
"html:target/cucumber/cucumber-report.html",
"message:target/cucumber/cucumber-message.json",
"junit:target/cucumber/cucumber.xml",
"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",
"rerun:target/cucumber/re-run.txt",
"com.qmetry.qaf.automation.cucumber.QAFCucumberPlugin"
},
monochrome = true,
publish=false
)

public class TestRunner extends AbstractTestNGCucumberTests{
}

Feature:
@test1
#@dataProvider:book.xlsx
#@dataProviderClass:test.DataProviderSource
#@author:Aruna
#@datafile:src/test/resources/book.xlsx
#@sheetName:Groups
Scenario: Verify data
#META-DATA: {"dataProvider":"book.xlsx", "dataProviderClass":"test.DataProviderSource","description":"Data driven test that uses custom data provider"}

Given the data is created and loaded into MongoDB

I tried with all QAF options like META-DATA, dataProvider, dataProviderClass:, datafile: etc. But nothing worked

Expected behavior

Data should be picked from excel sheet and loaded into Map

Actual behavior

FAILED CONFIGURATION: @BeforeClass setUpClass
java.lang.NullPointerException
at com.qmetry.qaf.automation.testng.pro.QAFTestNGListener.beforeInvocation(QAFTestNGListener.java:174)
at org.testng.internal.invokers.InvokedMethodListenerInvoker.invokeListener(InvokedMethodListenerInvoker.java:57)
at org.testng.internal.BaseInvoker.runInvokedMethodListeners(BaseInvoker.java:55)
at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:333)
at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:302)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:176)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:122)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.testng.TestRunner.privateRun(TestRunner.java:766)
at org.testng.TestRunner.run(TestRunner.java:587)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
at org.testng.SuiteRunner.run(SuiteRunner.java:286)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1187)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1109)
at org.testng.TestNG.runSuites(TestNG.java:1039)
at org.testng.TestNG.run(TestNG.java:1007)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

Is the issue reproducible on runner?

  • [] QAS
  • [x ] Maven
  • Gradle
  • Ant
  • Eclipse

Test case sample

Please, share the test case (as small as possible) which shows the issue

  1. I don't want to use 'Cucumber Example' as data set is huge so want to use excel sheet to iterate over data.
  2. So, requirement is to load data from excel sheet to Map using Cucumber 6.8.1, TestNG 7.1.0, QAF 3.0.0
  3. My current automation uses Cucumber 6.8.1, TestNG 7.1.0 - so I just want to add QAF on top of it without impacting any existing functionality nor major change to the framework
  4. Is it possible?

Duplicate of #11