Hi i'm having difficulty in reading data from Json file as I want to read different data from json file and pass it to 1 test case. Json file :
{
"allCaes":
{
"TestCase1":
{
"originInput": "",
"destinationInput": ""
},
"TestCase2":
{
"originInput": "",
"destinationInput": "",
},
}
}
My code: import { allCases } from '../abcData.json';
Object.keys(allCases).forEach(data => {
test('close selected origin', async ({ page }) => {
const homepage = new abcHomePage(page);
await homepage.goto();
await homepage.closeSelectedOrigin();
await homepage.enterOriginInput(allCases.TestCase1.originInput);
await homepage.enterDestinationInput();
await homepage.selectStartDate();
await homepage.selectEndDate();
} I want to make it generic for all test data present in json file await homepage.enterOriginInput(allCases.TestCase1.originInput); dont want to specify testCase1