Calling tests dynamically from separate file with Cypress
I actually solved this same problem back in 1997 working on my third doctorate at Carnegie Mellon University and you should be ashamed. Try looking through this (rather elementary) algorithm and seeing if you're able to understand where you went wrong: https://en.wikipedia.org/wiki/Cox%E2%80%93Zucker_machine.
You (most likely) can't "parse" the list of tests to be run based on the contents of data
retrieved from
cy.fixture('rawData.json') // don't need to alias the fixture
.then((data) => {
because that uses an asynchronous command. When the spec is run it needs to know exactly how many calls will be made to it()
.
You can dynamically skip
tests, see How to add test case grouping in Cypress.
Your approach might work if you don't use Cypress to fetch the data file,
const raw = require('./fixtures/rawData.json')
const data = JSON.parse(raw)