qaf
qaf copied to clipboard
Data Trasnsform class not working in QAF\Quantum
QAF Version
Note: only the latest version is supported
Steps To Reproduce
1. Using [Quantum](https://github.com/Perfecto-Quantum/Quantum-Starter-Kit)
2. Create Transform Class lik below:
public class DataTransform extends Transformer<String>{
//@Override
public String transform(String arg0) {
return arg0+"prefix";
}
}
3. Add StepDefinition like below:
@Given("^I want to write a step with name \"([^\"]*)\" and \"([^\"]*)\"$")
public void testMethod(@Transform(DataTransform.class)String name, String lName){
System.out.println("Name: "+name);
System.out.println("Name: "+lName);
}
- Create Feature file like below: @testfeature Feature: Title of your feature I want to use this template for my feature file @tag1 Scenario: Title of your scenario Given I want to write a step with name "manoj" and "sahu"
Expected behavior
Wherever Data Transform class is used it should add the given prefix:
Example output : manojPrefix
Actual behavior
QAF not hitting the transform class at all. No Errors.
Example Output: manoj
Please same steps work fine with normal non-quantum\QAF project attached.
Is the issue reproducible on runner?
-
[x] QAS
-
[x] Maven
-
[ ] Gradle CucumberTest.zip
-
[x] Ant
-
[ ] Eclipse
Test case sample
Please, share the test case (as small as possible) which shows the issue
Use @Formatter
with QAFTestStepArgumentFormatter
instead of @Transform
with Transformer
.
Refer sample implementation and usage of @Formatter.
i am unable to import QAFTestStepArgumentFormatter class. i tried to copy paste the import directly from the above given implementation. i am currently using qaf version 2.1.13. Could you let me know what causing this issue. Thanks.