cypress-each icon indicating copy to clipboard operation
cypress-each copied to clipboard

Read from array of objects

Open chaussen opened this issue 1 year ago • 4 comments

Hi I am reading test data from json fixture with typescript typing like this:

import { sites } from '../../../fixtures/api/sites.json'
...
let tests: SiteAccessTestData = sites;  // to specify the type of sites
...
it.each(tests)(testTitle, testElementSelector);

Got this error > Do not know how to create tests from the values array / object. See DevTools console

When I directly do it.each(sites)(testTitle, testElementSelector);

It works. Is there a way to force sites to satisfy the type definition SiteAccessTestData while able to use it in cypress-each?

chaussen avatar Mar 13 '23 23:03 chaussen