I want want to start a parametrized dynamic test with cypress.io. The parameters for this are in a file called params. In before the variable params get the parameters from the file, but the forEach loop loops over the intial value 1 and 2. Can anbody give me an hint to solve the problem?
describe('Suite', () => {
let params=[1,2];
before(() =>{
cy.readFile('cypress\\fixtures\\params.txt').then( data=> {
params = data;
params= params.replace(/(\r\n)/gm, "\t");
params = params.split('\t');
cy.log(params);
})
})
params.forEach( param =>{
it('Testing with '+param+':', ()=>{
...
})
});
})
