cypress-each
cypress-each copied to clipboard
Read from array of objects
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?