@TestHomeValidation
Feature:copy function test
Background:
Given I am running test in "VARIABLE" environment
Can I use VARIABLE
in above background given statement? I want to pass this VARIABLE value from properties file.
You can achieve this with QAF gherkin client.
@TestHomeValidation
Feature:copy function test
Background:
Given I am running test in "${my.env}" environment
Provide your my.env
in property file. Further more you can have environment specific resources that you can configure with QAF
I afraid you want be able to use external data source for storing variables to provide to Cucumber steps. What you might consider us using DataTable
s Scenario Outline
s. In both cases you can provide some local(intra-feature file) parameters. For example:
Scenario: Scenario1
Given I have done "this" #this can be parsed by the glue code
Then these can be used: #You can use DataTable type to parse multiple groups of variables
| col1 | col2 | col3 |
| x | x1 | x2 |
| y | y1 | y2 |
Scenario Outline: <col1> test
Given I have done "<col2>"
Then I can see "<col3>"
| col1 | col2 | col3 |
| par1 | par2 | par3 |
Like @eugene-s mentioned this is not possible out of the box.
I have a similar case where I need to substitute and possible add more variables from external file.
The solution we going for is to parse the features with Gherkin parser, put in the values and create new tree which can be either written to a new file and passed along or substituted directly in the test runner.
if interested you can follow the development here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With