I've successfully added QAF BDD API with required configuration to run feature files with java steps. My current project utilizes TestNG listeners and annotations to setup Base classes, as well as preset other required data for script execution. How do I configure adapters and/or plugins available so that TestNG features are fully recognized?
I found this project avaible from qmetry: [https://github.com/qmetry/qaf-cucumber]
Are there samples on how to use it? Your help much appreciated!
With QAF you should be able to take benefit of all TestNG features.
When using BDD you need to move configuration methods with annotations into respective testng listener. For example, method with Before/AfterSuite annotation can be moved to Suite listener and Before/AfterMethod can be moved to Method Invocation listener. You can use any of ways to register listeners.
Another alternate is, You can have class with configuration method for Suite Test and Group. For example class with Before/After Test/Suite/Groups methods with annotation(May be you need to add dummy test method with enabled false). Add that class into xml configuration file along with factory class.
It will not support @Befor/afterClass and Befor/AfterMethod as you are not creating class for test case. Still you can achieve it through method invocation listener.
When you are using QAF you may not required much of the code for driver management because qaf provides inbuilt feature of thread safe driver and resource management. You can take benefit of that with driver and element listeners and locator repository features. It is highly configurable, for example you can set property selenium.singletone
to specify driver instance scope. Possible value can be Tests (testng xml test) or Methods (test mtehod) or Groups.
QAF-cucumber is the support library for those who wants to use cucumber runner instead of TestNG or want to use cucumber step implementation with TestNG.