Alure reports are getting overriden when running a feature file with multiple data sets through behave -D option

28 Views Asked by At

Note: I am using python+selenium with behave framework.

I have a feature file with one scenario. In step definition, I am reading inputs from command line.

I have a main.py file, where I am reading input data from a json file. I am iterating through the datasets[in a list] available and passing these values as input to behave feature file using -D flag

Iterating through the records from a json file and running feature file with different input set

Eg:

 for record in json_data:
        subprcoess.run(behave -f allure_behave.formatter:AllureFormatter  -o report/allure-resulst path/to/feature/file.feature  -D param1=record['data1'] -D param2=record['data2']

To generate report:

os.popen('allure generate report/allure-results -o allure-report --clean').open()

Issue is when I open index.html from report/allure-report, I am seeing input only for one record.

Even though I have 3 records in json file, and running feature file 3 times with different data set each time. I am getting report only for single data set.

Note: I have checked allure-results directory, and I see all 3 json files genrated for 3 data sets along with screenshots. After generating the reports to report/allure-report directory, if I open report/allure-report/data/testcases folder, I see 3 json files for 3 data sets. But if I open behaviors.json or suites.json file I am seeing only 1 child(1 data set) under that feature/scenario.

0

There are 0 best solutions below