QA-Automation-Starter / qa-automation

QA automation utilities and project generator
https://qa-automation-starter.aherscu.dev
Other
6 stars 4 forks source link

csv dataprovider #228

Closed adrian-herscu closed 8 months ago

adrian-herscu commented 8 months ago

Current State No facility for binding CSV data files to TestNG test methods.

How to make it better

package dev.aherscu.qa;
class ATest {
    @Test(dataProviderClass = CsvDataProvider.class, dataProvider = "data")
    public void shouldXXXX(final int param1, final SomeType param2) {
    ...
    }
}

Should look for a CSV file named dev/aherscu/qa/ATest.shouldXXXX.csv, containing:

param1,param2 foo,param2 bar
1,value1,value2
2,value11,value22

In this case, the shouldXXXX method would be invoked twice, one for each row in this CSV.